0
Py
try: name = str(input()) if (len(name) > 4): print("welcome " + name) print("HERE IS YOUR DATA") print("name:" + name) else: raise TypeError except: print("INVALID NAME")
3 Réponses
+ 3
Tag the language you're using(Python, in this case)
Your program is working fine, what is your question with this?
+ 1
You don't need to use try, except in this case. If - else will do the work.
name = input()
if len(name)>4:
print("you write what you want")
else:
print("invalid name")
0
Yes
Rishi