Py | Sololearn: Learn to code for FREE!



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")

1/5/2022 4:57:12 AM

lucky hindustani gamer

3 Answers

New Answer


Tag the language you're using(Python, in this case) Your program is working fine, what is your question with this?


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")