
지갑에 돈이 10000원 이상 있으면 택시를 탑니다.
2000원 이상, 10000원 미만 있으면 버스를 탑니다.
그렇지 않으면 걸어서 집에 갑니다.
정답
draw_money = int(input("insert draw money : "))
if account >= draw_money:
account -= draw_money
print(str(draw_money) + "원이 인출 되었습니다.")
else:
print("인출이 불가능합니다. " + str(draw_money - account) + " 원의 잔액이 부족합니다.")
print("현재 잔액은 " + str(account) + " 원 입니다.")
string 데이터 타입의 format 함수
print("현재 잔액은 " + str(account) + " 원 입니다.")
print("현재 잔액은 {} 원 입니다. 인출금액은 {} 입니다.".format(account, draw_money))
print("현재 잔액은 {data1} 원 입니다. 인출금액은 {data2} 입니다.".format(data2=draw_money, data1=account))
format 은 str 처럼 매번 배꿔줘야되니깐 {}를 써서 포기 쉽게하는것이다 맨뒤에 .format를 써서 표현한다