๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
โœ’๏ธ Python Programming/์–ด์„œ์™€ ํŒŒ์ด์ฌ์€ ์ฒ˜์Œ์ด์ง€!_2019 Ver

[์–ด์„œ์™€ ํŒŒ์ด์ฌ์€ ์ฒ˜์Œ์ด์ง€!_2019 Ver] 3์žฅ Lab ๋„์ „๋ฌธ์ œ ํ’€์ด (1)

by A Lim Han 2023. 2. 17.

# 3์žฅ Lab ๋„์ „๋ฌธ์ œ ํ’€์ด (1)

 

 

104p_Lab ๋„์ „๋ฌธ์ œ)


  
number = int(input("์ง ๊ฐœ์ˆ˜: "))
total = 0
cnt = 1
for i in range (0, number):
weight = int(input("์ง ๋ฌด๊ฒŒ: "))
if (weight > 20) and (cnt == 1):
total = total + 20000
cnt = 0
else:
continue
if number >= 2:
total = total + 30000
else:
total = total
print("๋‚ฉ๋ถ€ํ•˜์‹ค ์ด ๊ธˆ์•ก์€", total, "์›์ž…๋‹ˆ๋‹ค.\n")

 

 

 

 

105p_Lab ๋„์ „๋ฌธ์ œ)


  
credit = int(input('ํ˜„์žฌ๊นŒ์ง€ ์ด์ˆ˜ํ•˜์‹  ํ•™์ : '))
if credit >= 140:
print('์กธ์—… ๊ฐ€๋Šฅ')
else:
print('์กธ์—… ๋ถˆ๊ฐ€')

 

 

 

 

106p_Lab ๋„์ „๋ฌธ์ œ)


  
number = int(input('์ •์ˆ˜๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”: '))
if ((number % 3) == 0):
print('3์˜ ๋ฐฐ์ˆ˜์ž…๋‹ˆ๋‹ค.')
else:
print('3์˜ ๋ฐฐ์ˆ˜๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค.')

 

 

 

 

107p_Lab ๋„์ „๋ฌธ์ œ)


  
x = int(input('์ฒซ ๋ฒˆ์งธ ์ •์ˆ˜: '))
y = int(input('๋‘ ๋ฒˆ์งธ ์ •์ˆ˜: '))
if ( x < y ):
min = x
else:
min = y
print(x, '์™€', y, '์ค‘ ๋” ์ž‘์€ ์ˆ˜๋Š”', min)

 

 

 

 

110p_Lab ๋„์ „๋ฌธ์ œ)


  
money = float(input("๊ตฌ์ž… ๊ธˆ์•ก: "))
total = money
if money > 100000:
total = money - (money * 0.05)
print('์ง€๋ถˆํ•˜์‹ค ๊ธˆ์•ก:', total)
else:
more = 100000 - money
print('์ง€๋ถˆํ•˜์‹ค ๊ธˆ์•ก:', total)
print(more, '์›์„ ๋” ์†Œ๋น„ํ•˜์‹œ๋ฉด 5% ํ• ์ธ๊ฐ€๊ฐ€ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค.')

 

 

 

 

116p_Lab ๋„์ „๋ฌธ์ œ)


  
ach = int(input('์‹ค์ ์„ ์ž…๋ ฅํ•˜์‹œ์˜ค: '))
goal = int(input('์‹ค์  ๋ชฉํ‘œ๋ฅผ ์ž…๋ ฅํ•˜์‹œ์˜ค: '))
if ach <= goal:
print('์‹ค์  ๋‹ฌ์„ฑ ๋ณด๋„ˆ์Šค๋Š” 0์›์ž…๋‹ˆ๋‹ค.')
else:
bonus = ach - goal
final_bonus = bonus * 0.1
print('์‹ค์  ๋‹ฌ์„ฑ ๋ณด๋„ˆ์Šค: ', final_bonus)

 

 

 

 

118p_Lab ๋„์ „๋ฌธ์ œ)


  
score = int(input('์„ฑ์ : '))
if score >= 95:
print('์„ฑ์ : A+')
elif score >= 90 and score < 95:
print('์„ฑ์ : A0')
elif score >= 80 and score < 90:
print('์„ฑ์ : B')
elif score >= 70 and score < 80:
print('์„ฑ์ : C')
elif score >= 60 and score < 70:
print('์„ฑ์ : D')
else:
print('์„ฑ์ : F')

 

 

 

 

119p_Lab ๋„์ „๋ฌธ์ œ)


  
age = int(input('๋‚˜์ด๋ฅผ ์ž…๋ ฅํ•˜์‹œ์˜ค: '))
if age >= 51:
print('๋…ธ๋…„๊ธฐ์ž…๋‹ˆ๋‹ค.')
elif age >= 31:
print('์žฅ๋…„๊ธฐ์ž…๋‹ˆ๋‹ค.')
elif age >= 19:
print('์ฒญ๋…„๊ธฐ์ž…๋‹ˆ๋‹ค.')
elif age >= 13:
print('์ฒญ์†Œ๋…„๊ธฐ์ž…๋‹ˆ๋‹ค.')
else:
print('์–ด๋ฆฐ์ด์ž…๋‹ˆ๋‹ค.')