+ 1

Why its showing error ?

print("Enter Password\n\n") psw = input(":") if (psw == "lol"): print("acces granted") else: print("get lost intruder")

26th May 2020, 3:04 AM
Lola
Lola - avatar
4 Respostas
+ 4
What about indentation. Keep it in mind just like another languages uses () for logic and {} for codes. In python indentation and : are used . It will be correct as \/ print("Enter Password\n\n") psw = input(":") if psw == "lol": print("acces granted") else: print("get lost intruder")
26th May 2020, 3:18 AM
Ayush Kumar
Ayush Kumar - avatar
0
𝐊𝐱𝐱𝐛𝐹 𝐆𝐡𝐚đČđšđ„ , I am saying you that don't write the code which is violating PEP-8 standard. Your code is correct but it is violating pep standard.
26th May 2020, 5:37 AM
$±𝐎â‚č𝔭!𝐹𝓝
$±𝐎â‚č𝔭!𝐹𝓝 - avatar
26th May 2020, 5:40 AM
$±𝐎â‚č𝔭!𝐹𝓝
$±𝐎â‚č𝔭!𝐹𝓝 - avatar
- 2
𝐊𝐱𝐱𝐛𝐹 𝐆𝐡𝐚đČđšđ„ Your code is violating PEP-8. One or more statement in single line. Run below code and check the output for line 27. https://code.sololearn.com/cktxB2CQLNJr/?ref=app
26th May 2020, 5:23 AM
$±𝐎â‚č𝔭!𝐹𝓝
$±𝐎â‚č𝔭!𝐹𝓝 - avatar