You can use while loop like this
name = input("So, what is your name? ")
while not name.isalpha():
print ("That's not a real name! Try again...")
name = input("So, what is your name? ")
print ("So your name is " +(name) + "? Awesome.")
First, it gets the name, and the while
loop makes sure that as long as the name
not only has alphabets, it will print That's not a real name! Try again...
and take input for name
. If the name
has only alphabets it automatically breaks out of the loop and prints "So your name is <name entered>? Awesome."
Edit: To make the first character an uppercase letter, you can use title function and instead of concatenating strings, you can format them like this.
print ("So your name is {}? Awesome.".format(name.title()))