Post

Python Programming
Python Programming@PythonPr·
Python Question / Quiz; What is the output of the following Python code, and why? Comment your answers below!
Python Programming tweet media
English
52
8
103
15K
Robin Fultz
Robin Fultz@robin16633·
@PythonPr The output would be 'y'(lower case). Because the print statement puts the letter in quotes making it text. None of the answers provided apply.
English
0
1
5
588
Sergei Kotov
Sergei Kotov@kotov_dev·
Answer: y (lowercase letter) The trap: print("y") prints the STRING "y", NOT the variable Y! › Y = 2 + 6 = 8 (variable value) › print("y") outputs: y (the literal text) For beginners: Quotes make it a string!
English
0
0
6
465
Omo Yewa
Omo Yewa@AceKelm·
@PythonPr The output is y. And it's not on the list of options. Many people who do not pay attention to little details might miss the answer.
English
0
0
2
137
Terrence
Terrence@terrenceeleven·
@PythonPr The pitfall here is that print("y") isn't a capital letter Y. B) Y .@PythonPr
English
0
0
2
614
Jay
Jay@learnaiwthme·
@PythonPr The output is y. Not Y. Not a number. Just the lowercase letter y. Why? Because this line: print("y") prints a string literal. It does not print the variable Y. If it were: print(Y) then the result would be 8 because Y becomes 2 + 6. So the correct answer is B) y.
English
0
0
1
513
Ehshanulla
Ehshanulla@Ehshanulla·
@PythonPr "Y" is a string literal print("Y") prints the character Y, not the variable Y "Y" → prints the letter Y Y → prints the value of the variable so output= Y
English
1
0
1
385
Jenny
Jenny@JennyTheDev·
@PythonPr Answer: B print("y") → prints the string "y" print(Y) → prints the variable Y = 8 Quotes matter. Always check your syntax
English
1
0
1
389
Siddartha DevOps
Siddartha DevOps@SiddarthaDevops·
@PythonPr "y" is string literal. python print exactly what is inside the quotes. iT does not print the variable value. so its prints : Y. quotes means text. this is fundamental concept of python.
English
0
0
1
190
Schwarz
Schwarz@schatten_70·
@PythonPr What do you mean with Y Capital Letter?
English
0
0
1
365
Eboniterod | Learning & Curiosity.
@PythonPr This is a value mismatch and value printed will be the string y which is not refering to the value capital Y. Python is case sensitive! So no option to pick from!
English
0
0
0
10
codeblock.io
codeblock.io@CodeBlock_io·
@PythonPr The correct answer is C. The output is y because the print statement is printing the string "y", not the variable y.
English
0
0
0
0
🪄 ✨MaPyc Key✨
🪄 ✨MaPyc Key✨@chegarra·
@PythonPr No existe respuesta correcta. E) y No es lo mismo "Y" que "y" ASCII de Y = 89 ASCII de y = 121 🤓🤓🤓
Español
0
0
0
3
kroo
kroo@alon14kfen·
@PythonPr Python is case-sensitive, so "y"
English
0
0
0
131
Paylaş