Question: Coding in python: Here is the error code I receive from my test: File ', line 38, in test_guessing_game self.assertEqual(0.0, guessing_game(2)) File , line 148,

Coding in python:

Here is the error code I receive from my test:

File "', line 38, in test_guessing_game

self.assertEqual(0.0, guessing_game(2))

File "", line 148, in guessing_game

guess = int(input('Take a guess: '))

ValueError: invalid literal for int() with base 10: 'n'

Coding in python: Here is the error code I receive from my

def guessing_game (money): Note: when you are asking the user if they would like to play again, make sure their answer is in the format 'y for yes and 'n' for no. Allows the user to play a guessing game for two dollars. Ask the user to play until they say no or until they can't pay. Parameters: money - an int representing how much money the user has Returns The user's money -2 if they failed to guess the correct number in 4 tries or the user's money+20 if they correctly guess the number. if not can_pay (money, 2): print( 'Sorry not enough money.') return money number random. randint (0,100) guess = int(input ('Take a guess: tries1 while True: ')) if guess number: print( VICTORY!' return money+20 else: if guess number: print('Lower') guess = int( input (Take a guess: tries += 1 if tries = 4: ) print( 'You Lose') return money - 20

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!