baseball-game tag

4 questions


2 answers
97 views
0
I made a baseball game, but I can't find the error.

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, ...


1 answers
108 views
0
I want to change the baseball game to a function, is there any other way to use global?

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...


1 answers
62 views
0
SyntaxError: invalid syntax // basball game is being made, but I don't know if there is a problem with the main function.

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...


1 answers
78 views
0
I'm asking you a question while making Python baseball game

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...

1 years ago

© 2024 OneMinuteCode. All rights reserved.