Post

Python Programming
Python Programming@PythonPr·
90% beginners give the wrong answer 🤔 Can you solve it? 👇 Comment your answer
Python Programming tweet media
English
52
12
133
19.5K
Robin Fultz
Robin Fultz@robin16633·
@PythonPr Go. Because "signal" returns False on the first two conditionals.
English
0
0
0
167
Awesome Banks
Awesome Banks@awesomebanks12·
@PythonPr Why would 90% get it wrong ? This is so basic that anyone would get
English
1
0
1
407
Roman Verbetskyi
Roman Verbetskyi@makusaxd·
@PythonPr The output is Go! Since "Green" doesn't match "Red" or "Yellow", it falls right into the else block. 🚀
English
0
0
0
34
Gopuff
Gopuff@gopuff·
Our delivery comes with a genius. Go learns what you like, builds your cart in seconds, and gets it all to your door in as fast as 15 minutes.
English
12
44
996
9.4M
Kylo Ren
Kylo Ren@KyloRen25644566·
@PythonPr It would still print "Go" since both if and elif statements are False. The outcome would only change if you set signal = " Red" or signal="Yellow"
English
0
0
0
283
Gabriel Brasovean
Gabriel Brasovean@gabrieldaybyday·
@PythonPr I am a writer with 2 days into vibe coding, where is everyone going? can I come with? I am fun and friendly I promise
English
0
0
0
791
hafsdkl
hafsdkl@ZlarkZets·
@PythonPr fun fact: you could've put "Leonhard Euler" in the value of signal it would still works
English
0
0
2
685
ReBet
ReBet@rebetapp·
Legal in your state
English
0
0
1
127.8K
Gg
Gg@GathogoMathenge·
@PythonPr The code is correct so it'll print "Go".
English
0
0
0
301
Mr. Tech
Mr. Tech@YoungSh32788105·
@PythonPr The program will always display or print go,since signal has been defined as green and there is no condition for if signal is green so the else statement will handle it making it printing Go always when it ru ln
English
0
0
0
112
espsstmh1211
espsstmh1211@espsstmh1211·
@PythonPr This seems less like a question about the answer "Go" and more like a question about what you prioritize regarding traffic light. That's because this problem prioritize when the light is red; if you were to prioritize green,the first 'if' statement would be ; if signal=="Green":
English
0
0
0
4
AI's Nest
AI's Nest@AINestHub1·
@PythonPr signal is set to "Green". ​It isn't "Red", and it isn't "Yellow". ​Because both conditions fail, the code drops straight into the else: block and prints Go.
English
2
0
1
309
BIGO LIVE
BIGO LIVE@BIGOLIVEapp·
Up late and bored? Tap into live conversations.
English
0
23
383
5M
Paylaş