4 questions
I made it like below, and it works well to the first function that prevents duplicate numbers.For example, if you enter 123 and you have at least one strike,If you repeatedly enter 123 several times, ...
Below is a baseball game that I have madeimport random answer = random.sample(range(1,10),3) tr_num = 0 # Variable indicating how many attempts have been madevariable representing the number of st...
def main(): print(Play Baseball)random_number = str(get_not_duplicated_three_digit_number())print(Random Number is : , random_number)user_input = '999'while(get_strikes_or_ball(user_input, random_numb...
import randomrandom_ball = random.sample((1,2,3,4,5,6,7,8,9),3)strike = 0ball = 0while True: Guess = input (Please enter three different baseball numbers (1 to 9): ) if random_ball == guess: print (C...
© 2024 OneMinuteCode. All rights reserved.