문제

Derick Lee·2022년 8월 21일
0

Python 101 08/21

목록 보기
4/5
1번문제

w = int(input("짐의 무게는 얼마입니까?"))
if w < 10:
    print("수수료는없습니다")
else:
    print("수수료는 10000원 입니다")

w = int(input("짐의 무게는 얼마입니까?"))
if w < 10:
    print("수수료는없습니다")
else:
    print("수수료는 {}원 입니다".format(int(w/10)*10000+10000))

2번문제

import random

print('>.숫자 맞추기 게임<<')
com = random.randint (1,10) # 1~10 사이 난수 정수 발생

while True:
    my = int(input('예상 숫자를 입력하시오 :')) # 숫자입력
    if com == my:
        print("~~성공~~")
        break
    elif com < my:
        print("더 작은 수 입력")
    else:
        print("더 큰 수 입력")

3번 문제
cnt = tot = 0
수열 = ()
while cnt < 100:
    cnt += 1
    if cnt%3 ==0 and cnt%6 != 0:
        tot += cnt
        print("수열 = {}".format(cnt))
print("누적합 = {}".format(tot))

pg. 77-79. 퀴즈.

0개의 댓글

관련 채용 정보