fork download
  1. name=["홍길동","이순신","황진이"]
  2. gender=["남","남","여","남"] #[0,0,1]
  3. time=[100,50,72,67]
  4. discount=["없음","청소년","국가유공자","없음"]
  5.  
  6. user=0
  7. price=0
  8. total_m=0
  9. total_w=0
  10. total_all=0
  11.  
  12. user=len(name) #length 회원 수 계산
  13. print("전체 사용자 수:",user,"명")
  14.  
  15. for i in range(0,user):
  16. price=time[i]*60*2 #1분 60초 /1초 2원
  17. #할인추가 코드
  18. if(discount[i]=="청소년"):
  19. price=price*0.8 #소수점
  20. price=int(price)
  21. elif(discount[i]=="국가유공자"):
  22. price=price*0.7 #소수점
  23. price=int(price)
  24. print(i,"번 사용자의 요금은",price,"원") #출력
  25.  
  26. if(gender[i]=="남"):
  27. total_m=total_m+price #누적
  28. elif(gender[i]=="여"):
  29. total_w=total_w+price #누적
  30. total_all=total_m+total_w
  31.  
  32. print("남자회원 요금 합:",total_m) #16800
  33. print("여자회원 요금 합:",total_w) #6048
  34. print("전체회원 요금 합:",total_all) #22848
Success #stdin #stdout 0.01s 7176KB
stdin
Standard input is empty
stdout
('\xec\xa0\x84\xec\xb2\xb4 \xec\x82\xac\xec\x9a\xa9\xec\x9e\x90 \xec\x88\x98:', 3, '\xeb\xaa\x85')
(0, '\xeb\xb2\x88 \xec\x82\xac\xec\x9a\xa9\xec\x9e\x90\xec\x9d\x98 \xec\x9a\x94\xea\xb8\x88\xec\x9d\x80', 12000, '\xec\x9b\x90')
(1, '\xeb\xb2\x88 \xec\x82\xac\xec\x9a\xa9\xec\x9e\x90\xec\x9d\x98 \xec\x9a\x94\xea\xb8\x88\xec\x9d\x80', 4800, '\xec\x9b\x90')
(2, '\xeb\xb2\x88 \xec\x82\xac\xec\x9a\xa9\xec\x9e\x90\xec\x9d\x98 \xec\x9a\x94\xea\xb8\x88\xec\x9d\x80', 6048, '\xec\x9b\x90')
('\xeb\x82\xa8\xec\x9e\x90\xed\x9a\x8c\xec\x9b\x90 \xec\x9a\x94\xea\xb8\x88 \xed\x95\xa9:', 16800)
('\xec\x97\xac\xec\x9e\x90\xed\x9a\x8c\xec\x9b\x90 \xec\x9a\x94\xea\xb8\x88 \xed\x95\xa9:', 6048)
('\xec\xa0\x84\xec\xb2\xb4\xed\x9a\x8c\xec\x9b\x90 \xec\x9a\x94\xea\xb8\x88 \xed\x95\xa9:', 22848)