Home / Expert Answers / Computer Science / consider-the-following-code-guessing-pyimport-random-some-global-password-information-which-is-ha-pa572

(Solved): Consider the following code:# guessing.pyimport random# Some global password information which is ha ...



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.



We have an Answer from Expert

View Expert Answer

Expert Answer


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe