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
Get step-by-step solutions from verified subject matter experts
