Question: In Python, there are two main rules for naming variables. The first character cannot be a number. Only letters, numbers, and the underscore character are

In Python, there are two main rules for naming variables.

The first character cannot be a number.

Only letters, numbers, and the underscore character are allowed.

Write a PYTHON program that prompts users to enter a potential variable name and tells them whether or not it is valid. Your program should consist of two functions. The first should take one argumentthe potential variable name, validate the name, and return Boolean True if it is valid or False if it is not. The second, a main()function, should get input from the user, call the validator function and print This is a valid variable name or This is not a valid variable name.

Users should repeatedly be prompted to enter another variable name until they enter done.

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!