-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWhileLoop.py
More file actions
37 lines (24 loc) · 975 Bytes
/
WhileLoop.py
File metadata and controls
37 lines (24 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#while loop = execute some code While some condition remains true
#name = input("Enter your name: ")
#while name == "":
# print("Error! No submitted entry")
# name = input("Enter your name: ")
#print(f"Welcome {name}")
#--------------------------------------------------
#age = int(input("Enter your age: "))
#while age < 0:
# print("Age can't be negative")
# age = int(input("Enter your age: "))
#print(f"You are {age} year old")
#--------------------------------------------------
#food = input("Enter a food you like (press q to quit): ")
#while not food == "q":
#print(f"You like {food}")
#food = input("Enter a food you like (press q to quit): ")
#rint("Bye")
#--------------------------------------------------
num = int(input("Enter a # between 1 - 10: "))
while num <1 or num > 10:
print(f"{num} is not valid")
num = int(input("Enter a # between 1 - 10: "))
print(f"Your number is {num}")