Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Spot the bug in the below code snippet H- Function to collect user data def collectuser ( ): f_mane = Input(Please enter your first narre:

image text in transcribed

Spot the bug in the below code snippet H- Function to collect user data def collectuser ( ): f_mane = Input("Please enter your first narre: ") 1_nane = input ("P1ease enter your last siame: -) age = int (input("Please enter your age: ")) 5n = int (input("Please enter your Soclal Security Number withcut dashses: ")) cc_nun = Int(input("Please enter your credit card number: ")) if isinstance(f_name, str) 1= True: print("Please enter a valld string first nane") exit( ) if isinstance (1_naine, str) 1= True: print( "Please enter a valid string last nane") exit() if isinstance(age, int) I= True: print( "Please enter a valld integer age") exit() if isinstance(ssn, int) I= True: print( "Please enter a valid 55N in the forn of all integers") exit() 1f isinstance(cc_num, int) 1 = True: print("Please enter a valid credit card nunber in thr form of all integers") exit() print(-A11. Input validated") print(f_natie, 1_nane, age, 5sn, cc_nuin) If Ca11 the function and use the data to print out a pwnd message to the user user_into = collectuser () print ("He1lo ff t }, you have been breached! Thank you for supplying your aget. \{\},5SN : \{\}, and Credit Card intormation: \{t+__format(user_info[0], user_info[1], user_info[2], use \( r_{\text {_info }}[3] \), user_inio [4]} There is no bug Too many individual if statements, some will not be evaluated Missing an import statement for the isinstance function Missing a return statement

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Logic In Databases International Workshop Lid 96 San Miniato Italy July 1 2 1996 Proceedings Lncs 1154

Authors: Dino Pedreschi ,Carlo Zaniolo

1st Edition

3540618147, 978-3540618140

More Books

Students also viewed these Databases questions

Question

5. To what extent is the learner compelled to understand meaning?

Answered: 1 week ago