Answered step by step
Verified Expert Solution
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:
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started