Exercise 1:
password = input("Please input password")
while password != "abc":
print("Wrong password.")
password = input("Please input one more time:")
print("Password is good")
Exercise 2:
i = 1
sum = 0
while i <= 100:
sum = sum + i
i = i + 1
print("1+2+3+4+5+…+100=",sum)
Homework:
number = int(input("What number multiplication table would you like to see?"))
i = 1;
while i < 10:
print(number,"x",i,"=",number*i)
i = i + 1
[…] 17 Rock Paper Scissor Shoot I| |____Unit 18 Rock Paper Scissor Shoot II|____Python Level 3| |____Unit 19 while loop| |____Unit 20 while loop practice| |____Unit 21 guess number game| |____Unit 22 for loop| |____Unit […]