+ 1
Deja Vu : code coach peobel
The given code will pass all the test in "Deja Vu" chellenge in coad coach expect the last one . I don't know why . Please help me out . word = input() def attention(data): for i,p in zip(data[0:] , data[1:]): if i is p: print("Deja Vu") break else: if p is data[-1]: print("Unique") attention(word)
10 ответов
+ 3
Try to put this input:
Saran
It will come unique because your program will check only the consecutive letters
It should be Deja Vu
See a shorter method to solve the problem:
https://code.sololearn.com/c2mMDtrlEnoQ/?ref=app
+ 2
here is my solution. slightly different approach
x = input("")
if len(x) > len(set(list(x))):
print("Deja Vu")
else:
print("Unique")
+ 1
Print out the tupels, then you'll see, you miss a lot... Especially at the end of the strings.
+ 1
Thanks Namit Jain
Finally I find the solution
word = input()
def atentuon(data):
string = []
for i in data:
if i in string:
return "Deja Vu"
else:
string.append(i)
return 'Unique'
def main():
print(atentuon(word))
main()
+ 1
Namit Jain cuz I'm a new bee 😅
I'll get to learn more ...
+ 1
Saran Ohh noo!
You are an awesome guy!
You tried!
And finally solved it! 🙃
+ 1
Namit Jain Thanks a lot 😁
+ 1
string = input()
u = False
for letter in range(0,len(string)):
unique = string[letter]
if unique in string[letter+1::]:
u = True
break
if u:
print("Deja Vu")
else:
print("Unique")
refer this code bro.
0
Saran great!
But why to make it lengthy? 🙃🤔
0
I'm in my noobie stages as well and I did it a little different the most. Idk if that's a good thing or not. So if someone has input, I'll gladly receive it.
rndm_char = input()
x = set(rndm_char)
re_strng = ''.join(x)
print('Unique' if len(rndm_char) == len(re_strng) else 'Deja Vu')