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
Assume that isIsosceles is a bool variable, and that the variables isoCount, triangleCount, and polygonCount have all been decla
svet-max [94.6K]

Answer:

if(isIsosceles){

isoCount+=1;

triangleCount+=1;

polygonCount+=1;

}

Explanation:

Here we are checking the condition for variable "isIsosceles" using if condition. if it is true then only if block executed and it will increment mentioned variable values by 1

4 0
4 years ago
1. Name the first PC virus.<br> 2. In which language are viruses written for Microsoft programs?
Tju [1.3M]

Answer:

The first IBM PC virus in the "wild" was a boot sector virus dubbed (c)Brain, created in 1986 by Amjad Farooq Alvi and Basit Farooq Alvi in Lahore, Pakistan, reportedly to deter unauthorized copying of the software they had written. The first virus to specifically target Microsoft Windows, WinVir was discovered in April 1992, two years after the release of Windows 3.0.

Explanation:

HOPE THIS HELPS

6 0
3 years ago
Read 2 more answers
How are special characters added to a Word document? Check all that apply.
MrRissso [65]

It kinda depends on what you mean by special characters

7 0
3 years ago
Read 2 more answers
Write a function add_spaces(s) that takes an arbitrary string s as input and uses recursion to form and return the string formed
kvasek [131]

Answer:

The solution code is written in Python:

  1. def add_spaces(s):
  2.    if len(s) < 2:
  3.        return s  
  4.    else:
  5.        return s[0] + " " + add_spaces( s[1 : ] )

Explanation:

Recursive function is a function that will call itself within the same function.

Let create a function named add_spaces() that take one input string, s (Line 1).

Next, create an if condition to check if the length of the input string is less than 2 (this means if the string has only one character), return the current string (Line 2-3).

Otherwise, it should return the first character of string, s[0] concatenated with a single space " " and concatenated again with the return output from the recursive calling add_spaces() that take s[1: ] as input parameter (Line 4-5). Please note s[1: ] is an expression we get the substring of the current string from position 1 till the end of string.

5 0
3 years ago
Read 2 more answers
when water is poured into a styrofoam cup, nothing happens. the water stays in the cup and it can be used for drinking. however,
KengaRu [80]

The backside of the cup disappears and the fuel pours out due to the fact styrofoam is a trading name for polystyrene (PS) foams, Gasoline is crafted from a mixture of hydrocarbons, so it dissolves PS, generating a viscose paste.

Gasoline is crafted from a combination of volatile, flammable liquid hydrocarbons derived from petroleum and used as gas for internal-combustion engines. It is likewise used as a solvent for oils and fats. Gasoline is a form of gas crafted from crude oil and different petroleum liquids. Gasoline is mostly used as an engine gas in vehicles.

Learn more about gasoline at brainly.com/question/28762820

#SPJ4

3 0
2 years ago
Other questions:
  • whats something that u want to do but ur parents wont allow it like having a phone or going to a college ​
    11·2 answers
  • WILL MARK BRAINLIEST IF ANSWERED ASAP
    10·1 answer
  • A data mart differs from a data warehouse in that: Group of answer choices it deals with a particular component or functional ar
    13·1 answer
  • Is the percentage of the original sample that successfully completed a survey.
    10·1 answer
  • For most applications, saving sound files at the _____ bit resolution provides a good balance of sound quality and file size.
    15·2 answers
  • Which of the following is an object-oriented prototype-based language? Java Pike REBOL MATLAB
    9·1 answer
  • You work in the educational software industry. Your boss asks you to give a brief lecture to other employees about the digital d
    7·2 answers
  • interpret the following SQL create table persons (person I'd int, last name varchar (255) first name varchar (255) address varch
    7·1 answer
  • A file named "dogs.txt" exists and has 60 lines of data. You open the file with the following line of code.
    5·1 answer
  • Describe how to create a new folder on the desktop​
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!