Python 7 Levels, L2, Unit 11, Logic Operators

Powered By EmbedPress

Exercise 1:

score1 = int(input("Please input your English score:"))
score2 = int(input("Please input your Math score:"))
if score1 > 90 and score2 > 90:
    print("Excellent!")
    print("Please go to Admin Office for gift.")
print("Achievement test.")

Exercise 2:

number = int(input("Please guess a number between 0 and 20:"))
if number == 5:
    print("Congratulations! You Win First Prize.")
if number == 3 or number == 9:
    print("Congratulations! You Win Second Prize.")
if number == 12 or number == 13 or number == 19:
    print("Congratulations! You Win Third Prize.")
print("Guess Number Game")

Homework:

score = int(input("Please input score of this month:"))
result = input("Have you finished your homework of this week?(yes/no)")
if score > 280 and result == "yes":
    print("You can play one hour video game.")
print("Test you can play video game or not.")

dahan1999

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts