-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconditionalstates.py
More file actions
46 lines (41 loc) · 1.04 KB
/
Copy pathconditionalstates.py
File metadata and controls
46 lines (41 loc) · 1.04 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
#if-else
age=int(input("please enter your age"))
if(age < 18):
print("you cannot enter this place!")
else:
print("welcome to this place!")
number=int(input("please enter a number"))
if(number <0):
print("this number is negative")
else:
print("this number can be 0 or positive")
#if-elif-else
operation=input("please choose an operation:")
if operation=="1":
print("operation 1 selected")
elif operation=="2":
print("operation 2 selected")
elif operation =="3":
print("operation 3 selected")
elif operation=="4": # #elif block is not used alone
print("operation 4 selected")
else: #else block is not used alone
print("invalid operation")
#grade evaluation system
note=int(input("please enter a note:"))
if(note>=90):
print("AA")
elif(note >=85):
print("BA")
elif(note >=80):
print("BB")
elif(note >=75):
print("CB")
elif(note >=70):
print("CC")
elif(note >=65):
print("DC")
elif(note>=60 ):
print("DD")
else:
print("FF")