Question:
Hey guys I cant seem to figure out this python. Can anyone help me? Asks the user for a number Prints out that number.?
k
2014-11-12 21:58:43 UTC
Prints out the number of
even numbers between 0 and the number entered. For example, if the
user enters the number "7", the program
output should
print out the number "4"

PLEASE HELP ME
Three answers:
2014-11-12 22:00:34 UTC
num = input (" ")

print (num)

i = 0

for g in num:

(indent)if g%2 == 0:

(double indent)i += 1

print (i)



that'll work
2014-11-12 22:09:36 UTC
num = input("Enter your number"); i=0 while (i<=num) if (i%2==0) print i i = i + 1



all even number's remainder when divided by 2 is 0. therefore if (i%2==0) is true then print the number
k
2014-11-12 22:02:24 UTC
thats all the information he gave me.. I can send the assignment if you wish?



Option 1: Python Programming

The Python programming language is very powerful, and is becoming quite popular. Your task is to learn

some of the basics of Python programming, and to create a program that does the following:

 Asks the user for a number.

 Prints out that number.

 Prints out the number of even numbers between 0 and the number entered. For example, if the

user enters the number "7", the program output should print out the number "4".


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...