I want this to take the name given, then repeat it giving it's length and recognize whether the input is numerical or alphabetic | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I want this to take the name given, then repeat it giving it's length and recognize whether the input is numerical or alphabetic

def rep(e): x=input() y=str.x print (y) inp=input("Give me a name: ") x=len(inp) if x<10: print ('Your name has less \n than 10 letters') else: print ('Your name has more \n than 10 letters')

17th Nov 2016, 11:47 PM
Kemuel Samuels
Kemuel Samuels - avatar
2 Answers
0
you can use isdigit func. to check if input is integers and isalpha func. to check if input is all alphabets
18th Nov 2016, 2:02 AM
Maxwell Miles
Maxwell Miles - avatar
0
I don't quite get it what you mean by "then repeat it" I can write the code to check alphabet or number if you want without string functions
18th Nov 2016, 2:06 AM
Maxwell Miles
Maxwell Miles - avatar