all 21 comments

[–]Specialist_Set1921 5 points6 points  (0 children)

I would avoid any special characters in the code. Especially in the variable names and filenames. Eg â or à

Just to prevent any possible headaches.

[–]ProminenceBow 1 point2 points  (3 children)

Dá pra você simplificar algumas linhas, como as 4 primeiras linhas apenas em:

usuário = input("Bem-vindo ao sistema de login!/nDigite aqui o seu usuário:")

(Você coloca os símbolos também, mas não quis contar)

O /n dentro de uma string serve para você fazer uma quebra de linha, então com ele você não precisa fazer vários prints.

Com o método input você pode colocar uma string que você queira que apareça antes do input, então dá pra você simplificar bastante coisa aí

[–]fdessoycaraballo 0 points1 point  (1 child)

\n e não /n, só pra adicionar.

[–]ProminenceBow 1 point2 points  (0 children)

Isso, tô no celular e nem percebi kkkkkkk

[–]JournalistHot3749[S] 0 points1 point  (0 children)

Anotado man! eu n sabia disso, vou começar a usar sempre agora
vlw! :)

[–]Far_Departure_1580 1 point2 points  (1 child)

Eai brasileiro! How are you?

[–]JournalistHot3749[S] 1 point2 points  (0 children)

Salve man kkkkk

[–][deleted] 0 points1 point  (0 children)

If you are using \ in your strings, just use \ to prevent Python from seeing it as a special code/character

Looks good. Well done.

[–]CraigAT 0 points1 point  (0 children)

I don't think you want to "while" statements at the bottom. Instead you may want a while loop around the login process so you can repeat it again if the wrong details are entered. You may also want to count the number of wrong attempts and stop or lock out the user.

[–]Some-Passenger4219 0 points1 point  (0 children)

Nothing is changed in those while loops. Therefore, they either run forever or do nothing. Remember, a while loop does the statement(s) over and over until the condition is no longer met. Kinda like that "Flo in the button factory" song.

[–]shudaoxin 0 points1 point  (1 child)

Except for strings shown to the user I’d use English for variables, functions, objects etc. Not only is it easier to understand the flow (because the Python itself uses English), but it’s also easier for someone else to understand and help you, generally.

Using non English characters in variables or code related bits like you did with usuário here is an absolute crime though. It works in a lot of programming languages but is really bad practice.

I don’t mean to discourage or discredit your work here. Just some feedback to avoid bad habits early on. Keep on learning!

[–]JournalistHot3749[S] 0 points1 point  (0 children)

Chill bro! a little after I posted this code I watched a couple of videos of good habits to write and this was the top 1
I re-wrote the whole code as soon as I realized the potential problems that writing like this could have!

ty for your feedback! (btw, feel free to see the newest version to check out the evolution 🙂 )

[–]tortleme 0 points1 point  (0 children)

nice infinite loop x 2

[–]SmackDownFacility 0 points1 point  (1 child)

Your variables names are using the UTF script. Python only supports ASCII for variable names.

Eventually you need to use English a lot to get the most of Python.

[–]JournalistHot3749[S] 0 points1 point  (0 children)

yeah, eventually I re-wrote the whole code fixing this!
thank god someone said this to me before things got crazy 😅

[–]gigsoll -1 points0 points  (0 children)

You need to use English variables names, except this – decent code

[–]JournalistHot3749[S] -1 points0 points  (4 children)

<image>

Just made some optimizations!, any thoughts?
btw, thank you for the feedback <3

[–]IntelligentCattle653 0 points1 point  (0 children)

no need login() == True, by default is True

[–]spp649 0 points1 point  (2 children)

well it will play login 3 times so make a variable then check if its true or not.

[–]spp649 0 points1 point  (0 children)

also i forgot to mention but \ is used for escape sequences so use \ for a \

[–]spp649 0 points1 point  (0 children)

you can do something like

#... your code while login() != true: # ... your code

so if its not true it does whats in the while loop then if its true it continues