본문 바로가기
파이썬 기초 연습장/조건문

[파이썬 조건문] 조건문 예제

by 신령 가비 2022. 7. 19.
728x90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#슈퍼
from random import *
슈퍼 = ["딸기""바나나""키위"]
print(type(슈퍼))
 
 
if "딸기" in 슈퍼:
    st_price = randrange(500020000500)
    print("오늘의 딸기 가격은", st_price, "원")
    if st_price >= 15000:
        print("딸기만 산다.")
    elif st_price >= 12000:
        print("바나나도 산다.")
    else:
        print("키위까지 산다.")
 
 
cs
728x90

댓글