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
61
23
216
19.6K
Sergei Kotov
Sergei Kotov@kotov_dev·
@PythonPr Answer: C (125). Btw, many beginners confuse ** (exponentiation) with * (multiplication). If this were 5 * 3, the answer would be 15. But 5 ** 3 means 5 to the power of 3, which equals 125.
English
1
1
18
700
Premakumar Thevathasan (Prem Iyer)
Premakumar Thevathasan (Prem Iyer)@KumarT00623760·
@PythonPr The ** operator in Python is used for exponentiation, which means it raises the first number to the power of the second number. In the given code: x is assigned the value 5. y is assigned the value 3. print(x ** y) calculates xy, or 5 ^ 3. The calculation is 5×5×5=125.
English
0
0
0
563
Robin Fultz
Robin Fultz@robin16633·
@PythonPr C. 125. Because the double asterisk tells Python to multiply 5 x 5 x 5 = 125
English
0
0
0
273
Yash
Yash@buildwithyash·
@PythonPr it will be option c because double astreik say raised to so its actually 5 raised to 3 so its equal to 125
English
0
0
0
764
A  H
A H@habdir·
@PythonPr Try this: x = -1.3 Print(floor(x)) What’s the output?
English
0
0
0
646
A  H
A H@habdir·
@PythonPr C. Exponentiation.
Français
0
0
0
401
Mr X
Mr X@MrX836321573383·
@PythonPr Double asterisks means x^y, so it should be 125.
English
0
0
0
33
Hamid Shahid
Hamid Shahid@ch_hamid77·
@PythonPr Answer: 125 The double asterisk (**)in Python represents exponentiation, meaning "raise to the power of".
English
0
0
0
179
Joe
Joe@Joe46791334·
@PythonPr D print() needs a string and that's a number.
English
0
0
0
13
Osita
Osita@osy101·
@PythonPr It is C. 5 exponential 3=125
English
0
0
0
167
Prajwal Mohite
Prajwal Mohite@prajwalmohite18·
@PythonPr Answer: 125 Explanation: Exponential Operator ( ** ), x ** y this implies x to the power y so 5 to the power 3 gives 125.
English
0
0
0
133
Paylaş