{}
A Python course that doesn't leave you guessing. See every step with our code visualizer.
Try it yourself!
A Python course that doesn't leave you guessing. See every step with our code visualizer.
Try it yourself!
run-icon
main.py
print("welcome to 21s") num1=int(input("you go first ")) print(f"curent total is {num1}") print(f"I choose {4-num1}") print("current total is 4") num2=int(input("you again ")) print(f"the current total is {4+num2}") print(f"I choose {4-num2}") print("the current total is 8") num3=int(input("you again ")) print(f"the current total is {4+num3}") print(f"I choose {4-num3}") print("the current total is 12") num4=int(input("you again ")) print(f"the current total is {4+num4}") print(f"I choose {4-num4}") print("the current total is 16") num5=int(input("you again ")) print(f"the current total is {4+num5}") print(f"I choose {4-num5}") print("the current total is 20") print("ha ha you lost")
Output