I think I've found a mistake in this example: | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
- 1

I think I've found a mistake in this example:

letters = ['a', 'b', 'c'] if 'z' in letters: print('any message') it returns False, but in your example it returns True please fix it with regards...

7th May 2018, 4:10 PM
Magomed Shamaev
Magomed Shamaev - avatar
24 Réponses
+ 5
I don't know if you tagged the right mod, for I can't check the Russian version ;) So I'm passing over to Kuba Siekierzyński .
7th May 2018, 4:50 PM
Tashi N
Tashi N - avatar
+ 5
OK, found it already. The Russian question contains ["a", "b", "c"] in the list, instead of ["a", "b", "z"]. Good eye, Magomed! Still, the question is valid even with this typo, as it tells to print "Yes" ONLY IF "z" is found in the list. So for the Russian version -- "Yes" will not be printed. The if statement, however, is correct anyway.
7th May 2018, 5:05 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 4
Hmm... is everything settled already? I have checked the lesson and it seems fine, but I'm checking for English version. Is RU version different in this aspect, Magomed?
7th May 2018, 5:02 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 1
eah there is no mistake
7th May 2018, 4:46 PM
Magomed Shamaev
Magomed Shamaev - avatar
+ 1
yes, I agree
7th May 2018, 5:13 PM
Magomed Shamaev
Magomed Shamaev - avatar
+ 1
2nd Jan 2019, 12:48 PM
Michael
0
Just found that example in last part of list in python and it's correct there is no mistake in that.
7th May 2018, 4:14 PM
Yugabdh
Yugabdh - avatar
0
I can send you a screen
7th May 2018, 4:15 PM
Magomed Shamaev
Magomed Shamaev - avatar
0
I checked in python console
7th May 2018, 4:16 PM
Magomed Shamaev
Magomed Shamaev - avatar
0
letters = ['a','b','c'] if 'z' in letters: print("yes") this is that question right ? If yes then read question properly it's correct
7th May 2018, 4:16 PM
Yugabdh
Yugabdh - avatar
0
in list there is no 'z', so it can't print 'yes'
7th May 2018, 4:18 PM
Magomed Shamaev
Magomed Shamaev - avatar
0
if z in list
7th May 2018, 4:18 PM
Magomed Shamaev
Magomed Shamaev - avatar
0
Yeah that's what motive of code it will print nothing
7th May 2018, 4:18 PM
Yugabdh
Yugabdh - avatar
0
there must be if 'z' not in letters
7th May 2018, 4:19 PM
Magomed Shamaev
Magomed Shamaev - avatar
0
is there a mistake?
7th May 2018, 4:21 PM
Magomed Shamaev
Magomed Shamaev - avatar
0
you can check the code yourself
7th May 2018, 4:21 PM
Magomed Shamaev
Magomed Shamaev - avatar
0
fill in the blanks to print yes if list contain z this is question and it's clear that it only going to print yes if it have z please consider "if present"
7th May 2018, 4:22 PM
Yugabdh
Yugabdh - avatar
0
already checked it out it will not print yes and that's what we need as output
7th May 2018, 4:23 PM
Yugabdh
Yugabdh - avatar
0
soon you'll see that I was right the question and the example totally wrong at least in russian
7th May 2018, 4:29 PM
Magomed Shamaev
Magomed Shamaev - avatar
0
hi
7th May 2018, 4:35 PM
Magomed Shamaev
Magomed Shamaev - avatar