Как исправить код\\how to fix code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Как исправить код\\how to fix code

Написал данный код но в выводе получаю ошибку, подскажите как это исправить. Как код должен работать: с помощью переменной act пользователь выбирает что хочет сделать, авторизоваться(0) либо зарегистрироваться(1) , после юзер вводит данные для входа/регистрации и ему выводит сообщение соответствующее результату его действий. Более подробно можете ознакомиться с кодом по этой ссылке: https://code.sololearn.com/c3Tvlfij8Y0q/?ref=app I wrote this code, but I get an error in the output, tell me how to fix it. How the code should work: using the variable variable, the user chooses what he wants to do, log in (0) or register (1), after the user enters the login / registration data and displays a message corresponding to the result of his actions. In more detail you can familiarize yourself with the code on this link: https://code.sololearn.com/c3Tvlfij8Y0q/?ref=app

16th Jan 2019, 8:21 PM
Rty Rty
4 Answers
+ 1
Python interpreter is very sensitive to indentation. You need to use the exact same amount of whitespace for the lines that belong to the same level. After your else: hit an enter, and all lines below should begin with 4 whitespaces. Except the last line, that prints registration complete, that would have 8 spaces indent.
16th Jan 2019, 9:13 PM
Tibor Santa
Tibor Santa - avatar
+ 1
Maybe the other issue is with how the sololearn playground works. Your program needs 6 inputs total. In SL the code is not executed interactively, you have to give all inputs at the start in the same popup, separated by newline (↩️)
16th Jan 2019, 9:18 PM
Tibor Santa
Tibor Santa - avatar
0
elif используется только в паре с if elif - [else if] [если же]. По логике условие не может начинаться с "Если же"
17th Jan 2019, 7:40 PM
Non
Non - avatar
0
А также не забывай про двоеточия в условиях И конечно же про табуляцию Вернись к началу курса по Python
17th Jan 2019, 7:41 PM
Non
Non - avatar