Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Spot the bug in the below code snippet # Function to collect user data def collectuser ( ) : f _ name = input (
Spot the bug in the below code snippet
# Function to collect user data
def collectuser:
fname inputPlease enter your first name:
lname inputPlease enter your last name:
age intinputPlease enter your age:
ssn intinputPlease enter your Social Security Number without dashses:
ccnum intinputPlease enter your credit card number:
if isinstancefname, str True:
printPlease enter a valid string first name\"
exit
if isinstancelname, str True:
printPlease enter a valid string last name\"
exit
if isinstanceage int True:
printPlease enter a valid integer age\"
exit
if isinstancessn int True:
printPlease enter a valid SSN in the form of all integers\"
exit
if isinstanceccnum, int True:
printPlease enter a valid credit card number in thr form of all integers\"
exit
printAll input validated\"
printfname, lname, age, ssn ccnum
# Call the function and use the data to print out a pwnd message to the user
userinfo collectuser
printHello you have been breached!! Thank you for supplying your age: SSN: and Credit Card information: formatuserinfouserinfouserinfo userinfo userinfo
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