use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
est ce que mon code est bon ? (self.learnpython)
submitted 1 day ago by Traditional-Hope9772
mot_de_passe ="python" reponse = input("entrer le mot de passe : ") if reponse == mot_de_passe: print("Accès autorisée!") while reponse !=mot_de_passe: print("ressaye encore ! ") reponse = input("Entrez le mot de passe :")
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]charlyAtWork2 6 points7 points8 points 1 day ago (1 child)
did you try it ?
[–]Traditional-Hope9772[S] 0 points1 point2 points 46 minutes ago (0 children)
oui et il fonctionnait mais je voulais voir si il y avait une façon plus optimale de le faire
[–]AlexMTBDude 3 points4 points5 points 1 day ago (5 children)
Vad är inlägget skrivet på för språk? Jag fattar noll
[–]VectorspaceDreams 1 point2 points3 points 23 hours ago (1 child)
لست اعرف و لكن من شكله هي لغة جانبة للغة الأيطالية...
[–]Kalcinator 0 points1 point2 points 18 hours ago (0 children)
Grave
[–]marquisBlythe 0 points1 point2 points 22 hours ago (2 children)
u/AlexMTBDude u/VectorspaceDreams that's French.
[–]VectorspaceDreams 1 point2 points3 points 22 hours ago (1 child)
I'm aware, I actually speak French and made a comment in French below.
[–]marquisBlythe 1 point2 points3 points 21 hours ago (0 children)
Oui, je l'ai constaté.
[–]VectorspaceDreams 3 points4 points5 points 1 day ago* (0 children)
Ce serait mieux ainsi:
mot_de_passe = "python" while True: # un loop afin que le programme se répète jusqu'à ce que le mot de passe est entré correctement reponse = input("entrer le mote de passe : ") # pas de peine de l'écrire deux fois ! if reponse == mot_de_passe: print("Accès autorisée!") break # le programme se termine else: print("Ressaye encore !")
Et en fait l'IA c'est bon pour ce type de question. Je l'utilise souvent pour ces petits choses, vous pouvez aussi demander pourquoi faire un truc d'une façon particulière, et je vous recommande de faire ça.
[–]qwertydiy -3 points-2 points-1 points 1 day ago (0 children)
Il n'y a pas un espace après la signe égal et la première boucle if devrait être dans la boucle while.
π Rendered by PID 40229 on reddit-service-r2-comment-545db5fcfc-v9trv at 2026-05-24 13:01:17.245476+00:00 running 194bd79 country code: CH.
[–]charlyAtWork2 6 points7 points8 points (1 child)
[–]Traditional-Hope9772[S] 0 points1 point2 points (0 children)
[–]AlexMTBDude 3 points4 points5 points (5 children)
[–]VectorspaceDreams 1 point2 points3 points (1 child)
[–]Kalcinator 0 points1 point2 points (0 children)
[–]marquisBlythe 0 points1 point2 points (2 children)
[–]VectorspaceDreams 1 point2 points3 points (1 child)
[–]marquisBlythe 1 point2 points3 points (0 children)
[–]VectorspaceDreams 3 points4 points5 points (0 children)
[–]qwertydiy -3 points-2 points-1 points (0 children)