How could I simplify my code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How could I simplify my code

https://code.sololearn.com/c7iI3t568VRw/?ref=app This was for deja vu in code coach Ajith

30th Aug 2020, 3:51 AM
Smiley[Offline]
3 Answers
+ 6
This could be the simplest way ig https://code.sololearn.com/c2mMDtrlEnoQ/?ref=app
30th Aug 2020, 8:16 AM
Namit Jain
Namit Jain - avatar
+ 2
smiley string=list(input()) print('Unique') if len(string)==len(set(string)) else print('Deja Vu') hope this concept will help you to simplify your code
30th Aug 2020, 5:31 AM
Ajith
Ajith - avatar
+ 1
Well, this is what I came up with. Hope it helps. str = input() lst = [] bool = True for letters in str: if letters not in lst: lst.append(letters) else: bool = 'False' if bool == True: print('Unique') else: print('Deja Vu') P.S. - Python definitely makes a code a lot easier and shorter :)
30th Aug 2020, 4:39 AM
Rashmi
Rashmi - avatar