-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprac_2.py
More file actions
36 lines (32 loc) · 1.14 KB
/
prac_2.py
File metadata and controls
36 lines (32 loc) · 1.14 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
#while문, 조건문 연습
print('이 프로그램은 점수를 입력하면 성적을 출력해주는 프로그램입니다.')
st_name=''
st_score=4.5
p_again=''
while p_again != 'quit':
st_name=input('What is your name?')
message=f'Hi! {st_name}, '
print(message)
st_score=float(input('put your score here>>'))
if st_score >= 4.5:
print('Your score is A+')
elif (st_score < 4.5) and (st_score >= 4.0):
print('Your score is A0')
elif (st_score < 4.0) and (st_score >= 3.5):
print('Your score is B+')
elif (st_score < 3.5) and (st_score >= 3.0):
print('Your score is B0')
elif (st_score < 3.0) and (st_score >= 2.5):
print('Your score is C+')
elif (st_score < 2.5) and (st_score >= 2.0):
print('Your score is C0')
elif (st_score < 2.0) and (st_score >= 1.5):
print('Your score is D+')
elif (st_score < 1.5) and (st_score >= 1.0):
print('Your score is D0')
else:
print('You fail the class')
p_again=input('''\'quit\' if you want to stop,
else push any key>>''')
if p_again == 'quit':
print('program finished')