파이썬 게임1 파이썬 기초 실습_ 숫자 맞추기 게임 실습코드더보기import random def number_guess_game(): # 1부터 100 사이의 랜덤 숫자 생성 target_number = random.randint(1, 100) attempts = 0 max_attempts = 10 print("1부터 100 사이의 숫자를 맞춰보세요!") print(f"기회는 총 {max_attempts}번 있습니다.") while attempts # 남은 기회 표시 print(f"\n남은 기회: {max_attempts - attempts}번") # 사용자 입력 받기 try: guess = i.. 2025. 1. 18. 이전 1 다음