Question: Fix Input Validation in code please. Here is my code: while True: try: name = str ( input ( ' What is your first name?

Fix Input Validation in code please.
Here is my code:
while True:
try:
name = str(input('What is your first name?'))
break
lastName = str(input('Whay is your last name?'))
break
except ValueError:
print('Please do not use any symbols')
print('Hello ', name, lastName)
Please make it so if user inputs a symbol, the error message "Please do not use any symbols" pops up. As of now, I am getting the error but it's not printing the message.

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!