1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Inessa05 [86]
3 years ago
13

In python please!! Write the definition of a function named countPos that needs integer values from standard input until there a

re none left and returns the number that are positive. The function must not use a loop of any kind.
Computers and Technology
1 answer:
jek_recluse [69]3 years ago
8 0

Answer:

Explanation:

The following code is written in Python it doesn't use any loops, instead it uses a recursive function in order to continue asking the user for the inputs and count the number of positive values. If anything other than a number is passed it automatically ends the program.

def countPos(number=input("Enter number: "), counter=0):

   try:

       number = int(number)

       if number > 0:

           counter += 1

           newNumber = input("Enter number: ")

           return countPos(newNumber, counter)

       else:

           newNumber = input("Enter number: ")

           return countPos(newNumber, counter)

   except:

       print(counter)

       print("Program Finished")

countPos()

You might be interested in
C++ question:
gogolik [260]
There's no "using namespace std;" statement. I see no reason for COLOR to be two dimensional or have a length of 5 with only four elements. The inside of the for loop with variable 'J' makes no sense.
3 0
3 years ago
Read 2 more answers
In which part is data processing done?
postnew [5]
Data processing is done in cpu of computer
4 0
4 years ago
The following binomial coefficient identity holds for any integer
Iteru [2.4K]

Answer:

hello your question is incomplete attached below is the complete question and answer

answer ; attached below

Explanation:

To prove this identity combination the right hand side has to be equal to the left hand side attached below is the prove showing that the right hand side is equal to the left hand side

5 0
3 years ago
What are five features of word 2016 you would use to capture the attention of the target audience? Defend you decisions
Lyrx [107]
Here is my top 5:
1. Auto save feature. It's very important not to lose the writing when something happened to your computer while you were writing.
2. Synchronization with OneDrive. If something happened to your hard drive, you can backup your docs with OneDrive cloud.
3. You can view and edit PDF documents. Everyone needs it.
4. You can share your documents with other people and you can edit it together in online mode.
5. Improved "Red mode" which disables extra menus to view your documents.
5 0
3 years ago
i need big help so everyday my computer add new tabs when im working and what i do is check for viruses and watch vidoes how to
Sladkaya [172]

Since your computer add new tabs when you are working and the thing to do are:

  • You may manually scan for malware as well.
  • Launch Chrome.
  • Click More. Settings in the top right corner.
  • After clicking Advanced Reset, tidy up. tidy up the PC.
  • Choose Find.
  • Click Delete if you are prompted to remove undesirable software. Your computer might need to be restarted.
<h3>Why do my computer's tabs keep growing?</h3>

The chance exists that some form of malware has been installed on your computer, and this is what is causing the tabs to open randomly. Corrupt Installation: It's also possible that this problem is being brought on by a corrupt Chrome browser installation.

To access the Chrome Settings menu, enter chrome:/settings and press Enter. In the Extensions tab, locate New Tab.

One can still solve the problem by: To access the Chrome Settings menu, enter chrome:/settings into the address bar of Chrome and hit Enter. Click on the trash can icon on the "Extensions" tab of the Chrome Settings menu.

Please look for any further dubious extensions that you do not use or are unsure of their origin and remove them as well.

Learn more about Malware attack from

brainly.com/question/17311729
#SPJ1

5 0
1 year ago
Other questions:
  • If you are planning to carry a large balance on your credit card, which of the following credit card features should you look fo
    7·2 answers
  • Your friend is working on fixing their Homework assignment. They need a lot of help. You know all the bugs in the file, but due
    12·1 answer
  • Jeremy is designing a website for a local pizza place. What is the appropriate resolution for him to set his images to?
    5·1 answer
  • What type of window are you opening when you click the Start button on the Windows desktop, and then click the name of an app
    9·1 answer
  • An email address is made up of all of the following parts except
    13·2 answers
  • 6. Which of the following is malware? (1 point)
    10·2 answers
  • (Java)
    12·1 answer
  • PLEASE HELP ASAP!!
    6·2 answers
  • Which of the statements is most likely true about the differences between the basic version and premium version of StreamPal
    9·2 answers
  • Need help ASAPppppppppp
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!