This is the code and it doesn't run completely, I don't know what's wrong because it also says that there is no error/s at all. Hope you help me with this.
ign = input("Pick an In Game Name!: ")
print(" Welcome to the guessing game ", ign ,"! ")
import random
def guess_number(s):
randomnum = random.randint (1, s )
guessnum = 0
while guessnum != randomnum:
guessnum = int(input(f"Guess the number, choose an integer from 1 -{s}:"))
if guessnum < randomnum:
print ("Guess again the value is low!!")
elif guessnum > randomnum:
print ("Guess again the value is high!!")
print (" Congratulations! You guessed ",randomnum," Right! ")
guess_number= 10
ign = input("Pick an In Game Name!: ")
print(" Welcome to the guessing game, ", ign ,"! ")
import random
def guess_number(s):
randomnum = random.randint (1, s)
guessnum = 0
while guessnum != randomnum:
guessnum = int(input(f"Guess the number, choose an integer from 1 -{s}:"))
if guessnum < randomnum:
print ("Guess again the value is low!!")
elif guessnum > randomnum:
print ("Guess again the value is high!!")
print (" Congratulations! You guessed ",randomnum," Right! ")
guess_number(10) # you forgot brackets - function args must be in them
Comments
Leave a comment