Практична робота № 03 Тиждень №3
Прізвище, Ім’я ______________________________Клас __________________
|
temperature = float(input("Temperature: ") if temperature > 90: print("It is hot outside.") else: print("It is not hot out.") |
(1 б.)
|
user_input = input("A cherry is a: ") print("A. Dessert topping") print("B. Desert topping") if user_input.upper() == "A": print("Correct!") else: print("Incorrect.") |
|
x == 4 if x >= 0: print("x is positive.") else: print("x is not positive.") |
|
x = input("Enter a number: ") if x = 3 print("You entered 3") |
|
answer = input("What is the name of Dr. Bunsen Honeydew's assistant? ") if a = "Beaker": print("Correct!") else print("Incorrect! It is Beaker.") |
|
x = input("How are you today?") if x == "Happy" or "Glad": print("That is good to hear!") |
|
x = 5 y = x == 6 z = x == 5 print("x=", x) print("y=", y) print("z=", z) if y: print("Fizz") if z: print("Buzz") |
|
x = 5 y = 10 z = 10 print(x < y) print(y < z) print(x == 5) print(not x == 5) print(x != 5) print(not x != 5) print(x == "5") print(5 == x + 0.00000000001) print(x == 5 and y == 10) print(x == 5 and y == 5) print(x == 5 or y == 5) |
|
print("3" == "3") print(" 3" == "3") print(3 < 4) print(3 < 10) print("3" < "4") print("3" < "10") print( (2 == 2) == "True" ) print( (2 == 2) == True ) print(3 < "3") |
(1 б.)
|
print("Welcome to Oregon Trail!") print("A. Banker") print("B. Carpenter") print("C. Farmer") user_input = input("What is your occupation? ") if user_input = A: money = 100 else if user_input = B: money = 70 else if user_input = C: money = 50 print("Great! you will start the game with", money, "dollars.") |