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
IgorC [24]
3 years ago
8

Assignment 4: Evens and Odds (FIX PLEASE)

Computers and Technology
1 answer:
Ivanshal [37]3 years ago
3 0

n = int(input("How many numbers do you need to check? "))

odd = 0

even = 0

for x in range(n):

   num = int(input("Enter number: "))

   if num % 2 == 0:

       even += 1

       print(str(num)+" is an even number")

   else:

       odd += 1

       print(str(num)+" is an odd number")

print("You entered "+str(even)+" even number(s).")

print("You entered "+str(odd)+" odd number(s).")

This uses a for loop. Sorry about the previous answer. Also, you may want to check the text inside the input functions. For instance, int(input("Enter number: ")) might have different capitalization similar to int(input("Enter Number: "))

You might be interested in
Write out code for a nested if statement that allows a user to enter in a product name, store the product into a variable called
OlgaM077 [116]

Answer:

product_name = input("Enter product name : ")

if product_name=="pen"or"book"or"box"or"pencil"or"eraser":

   if product_name == "pen":  

       amount = 10

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "book":

       amount = 100

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "box":  

       amount = 150

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "pencil":  

       amount = 5

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "eraser":

       amount = 8

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

else:  

   print("Item not found!")

Explanation:

The python program is a code of nested if-statements that compares the input string to five items of the first if-statement. For every item found, its code block is executed.

6 0
3 years ago
Recently, a serious security breach occurred in your organization. An attacker was able to log in to the internal network and st
natulia [17]

Answer: Geotagging was enabled on her smartphone

Explanation:

The security weakness that is the most likely cause of the security breach is that geotagging was enabled on the vice president's smartphone.

Geotagging, occurs when geographical identification metadata are added to websites, photograph, video, etc. Geotagging can be used to get the location of particular place.

In this case, since geotagging was enabled on her smartphone, it was easy for the attacker to locate her house.

8 0
3 years ago
I need help quick Which of the following principles is not part of the constitution?
laila [671]

Answer:

Confederalism is not in the constitution it was adopted later.

Explanation:

5 0
3 years ago
____and___ are the two major techniques involved in green computing. //help \\
Rasek [7]
Virtualization and dynamics I think.
7 0
3 years ago
How can a robot differentiate between positive or negative product reviews?
Levart [38]

Answer:

Some of the sites have the rating system for example 3 stars, or the bot has a feature that can capture keywords that include a list of possible indicator that it is a negative review. For example if a user review includes a word "bad" or "horrible" the bot will flag that as a negative review.

Please give brainliest.

3 0
2 years ago
Other questions:
  • The sun produces energy by the process of nuclear: <br><br> A.fission <br> B.fusion
    7·2 answers
  • Does anyone know how to cancel a Pandora Free Trial Subscription? I need to cancel it by tomorrow. Please help!
    12·1 answer
  • Match the challenge with the term or process that offers a solution.
    6·1 answer
  • Select a classification for File2 so that: Alice can read and write to File2 Bob and Charlie can write to File2, but can't read
    6·1 answer
  • Which of the following is true regarding packaged software and custom software? Group of answer choices Packaged software are ap
    13·1 answer
  • Which of the following OSI layers is responsible for the segmentation, multiplexing, flow control and host-to-host communication
    6·1 answer
  • What important feature of an email gives you a clue about what the sender wants to tell you?
    12·2 answers
  • Why hackers hack?? in other people?​
    8·2 answers
  • HURRRY WILLL GIVE BRAINLIST!!!!!!
    12·1 answer
  • I am booooooored any one want to join
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!