Answer:
reading view
Explanation:
cause all others will inflict change
Answer:immersive view
Explanation:if he’s really focused on it he won’t make and more edit mistakes
This answer is wrong I’m sorry
pls answer this fellow coders i need it so bad
# Heading (name, date, and short description) feel free to use multiple lines
def main():
# Initialize variables
numGuesses = 0
userGuess = -1
secretNum = 5
name = input("Hello! What is your name?")
# Fill in the missing LOOP here.
# This loop will need run until the player has guessed the secret number.
userGuess = int(input("Guess a number between 1 and 20: "))
numGuesses = numGuesses + 1
if (userGuess secretNum):
print("You guessed " + str(userGuess) + ". Too high.")
# Fill in missing PRINT statement here.
# Print a single message telling the player:
# That he/she guessed the secret number
# What the secret number was
# How many guesses it took
fill in the missing code
This is how I would do it using the main function:
def main():
num_guesses = 0
secret_num = 5
name = input("Hello! What is your name? ")
while True:
user_guess = int(input("Guess a number between 1 and 20: "))
if user_guess == secret_num:
num_guesses += 1
break
elif user_guess < secret_num:
num_guesses += 1
print("You guessed {}. That was too low!".format(user_guess))
elif user_guess > secret_num:
num_guesses += 1
print("You guessed {}. That was too high!".format(user_guess))
print("The secret number was {}. You guessed it correctly in {} tries".format(secret_num, num_guesses))
if __name__ == "__main__":
main()
I hope this helps!
To generate integers between and including -10 to 10 you would use: