Question: Consider the following code:# guessing.pyimport random# Some global password information which is hard - codedpasswords = { joe : world 1 2 3

Consider the following code:# guessing.pyimport random# Some global password information which is hard-codedpasswords={"joe": "world123","jane": "hello123"}def game():"""A guessing game """# Use 'input' to read the standard inputvalue=input("Please enter your guess (between 1 and 10): ")print("Entered value is",value)if value == random.randrange(1,10):print("You won!")else:print("Try again")if __name__=="__main__":game()The given code provides information about passwords on entering invalid input, as shown:$ python2 guessing.pyPlease enter your guess (between 1 and 10): passwords('Entered value is',{'jane': 'hello123', 'joe': 'world123'})Try againHow can you make the code more secure in Python 2?Each correct answer represents a complete solution. Choose three.This type of question contains radio buttons and checkboxes for selection of options. Use Tab for navigation and Enter or space to select the option.Aoption AReplace input with raw_input.Boption BCast the return data to an int.Coption CAdd an exception handler.Doption DUse eval function.

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!