-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConditionalState.py
More file actions
108 lines (68 loc) · 2.23 KB
/
Copy pathConditionalState.py
File metadata and controls
108 lines (68 loc) · 2.23 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# # 10 09 2026
# # it helps you to execute a block of codes depending upon specified condition
# x = 10
# if x == 10: # to check if the value to be exact same or not
# print("x is exactly equal to 10")
# else:
# print("x is not equal to 10")
# # print("The value of x is: ",x)
# # with user input
# x = int(input("Enter the value of x: ")) # input is used to take user input0
# if x == 10: # to check if the value to be exact same or not
# print("x is exactly equal to 10")
# else:
# print("x is not equal to 10")
# x = int(input("Enter the value of x: ")) # input is used to take user input0
# if x <10: # to check if the value to be exact same or not
# print("x is less than 10")
# elif x>10:
# print("x is greater than 10 ")
# else:
# print("x is not leser or greater than 10")
print("Check range of number")
num = int(input("Enter a number: "))
if num >= 90 and num <= 100:
print("Number is between 99 and 100")
elif num >= 80 and num <= 89:
print("Number is between 80 and 89")
elif num >= 70 and num <= 79:
print("Number is between 70 and 79")
elif num >= 60 and num <= 69:
print("Number is between 60 and 69")
elif num >= 50 and num <= 59:
print("Number is between 50 and 59")
elif num >= 40 and num <= 49:
print("Number is between 40 and 49")
elif num >= 30 and num <= 39:
print("Number is between 30 and 39")
elif num >= 20 and num <= 29:
print("Number is between 20 and 29")
elif num >= 10 and num <= 19:
print("Number is between 10 and 19")
else:
print("Number is less than 10")
#OR
print("Check range of number")
num = int(input("Enter a number: "))
if (num >=90):
print("Number is between 99 and 100")
elif (num >=80):
print("Number is between 80 and 89")
elif (num >=70):
print("Number is between 70 and 79")
elif (num >=60):
print("Number is between 60 and 69")
elif (num >=50):
print("Number is between 50 and 59")
elif (num >=40):
print("Number is between 40 and 49")
elif (num >=30):
print("Number is between 30 and 39")
elif (num >=20):
print("Number is between 20 and 29")
elif (num >=10):
print("Number is between 10 and 19")
elif (num <10):
print("Number is less than 10")
else:
print("Invalid Input")