+ 2

What is wrong in this code

https://code.sololearn.com/cN8WBwICBgJQ/?ref=app What is wrong here

6th Aug 2020, 4:29 AM
Ved Thaker
Ved Thaker - avatar
6 odpowiedzi
+ 3
add one more = on line 9 as you are comparing string to 'abcdef'
6th Aug 2020, 4:42 AM
BroFar
BroFar - avatar
+ 4
Line 9: You have used = instead of ==, which only assigns again to `password` the value of "abcdef" and returns it. Because if requires a bool and the condition returns a string, it gives error.
6th Aug 2020, 4:42 AM
XXX
XXX - avatar
+ 4
XXX BroFar Artem thank you all
6th Aug 2020, 5:25 AM
Ved Thaker
Ved Thaker - avatar
+ 3
Ved Thaker please do not mark your own answer as best answer as this can be seen as a negative behavior... Thanks and happy coding.
6th Aug 2020, 5:35 AM
BroFar
BroFar - avatar
+ 2
Line 9: if (password = "abcdef") The thing you do here is assigning variable password to "abcdef", but you need to compare it. Use == instead of = here.
6th Aug 2020, 4:49 AM
Artem 🇺🇦
Artem 🇺🇦 - avatar
+ 2
6th Aug 2020, 6:34 AM
Ved Thaker
Ved Thaker - avatar