Py | Sololearn: Learn to code for FREE!

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

1/5/2022 4:57:12 AM

lucky hindustani gamer

3 Answers

New Answer

+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