salma_51999
Badges: 7
Rep:
?
#1
Report Thread starter 2 years ago
#1
This is what I've done so far, but I can't answer the question if the user inputs an odd number that <4 and >30:

number = int(input("Enter an even number that is greater than 4 and less than 30:"))
if number < 30 and number > 4 and number % 2 == 0:
print("OK,Here are the rules:")
else:
print("Enter an even number that is greater than 4 and less than 30:")
0
reply
Zargothrax
Badges: 3
Rep:
?
#2
Report 2 years ago
#2
(Original post by salma_51999)
This is what I've done so far, but I can't answer the question if the user inputs an odd number that <4 and >30:

number = int(input("Enter an even number that is greater than 4 and less than 30:"))
if number < 30 and number > 4 and number % 2 == 0:
print("OK,Here are the rules:")
else:
print("Enter an even number that is greater than 4 and less than 30:")
What exactly is the queston? like what critera must you meet? im happy to try to help if i can
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Current uni students - are you thinking of dropping out of university?

Yes, I'm seriously considering dropping out (185)
14.2%
I'm not sure (59)
4.53%
No, I'm going to stick it out for now (381)
29.24%
I have already dropped out (37)
2.84%
I'm not a current university student (641)
49.19%

Watched Threads

View All
Latest
My Feed