Alice = Bob = Eve

1
2
3
4
Bob = 16
Eve = 23
Alice = Bob = Eve
print (Alice, Bob, Eve)

What's the output of the above Python code?

Clarification: The code above is in Python 3

Error in Line 03 Error in Line 04 23 23 23 16 23 23 Error in Lines 03 & 04 16 16 16

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

4 solutions

Just put the code into an online python IDE and run the code because the questions answer would have to be solved by a computer due to logistical problems.

Wang Xingyu
Jul 4, 2020

In python, assignment statements are always starting from the right side of the equal sign. In this expression, Bob has an identical address with Eve and Alice, so they are all 23.

B D
Sep 1, 2018

Write the code into brilliants coding environment (click the globe(up, right) scroll down and click the button coding environment.

Munem Shahriar
Dec 9, 2017
1
2
3
4
Bob = 16
Eve = 23
Alice = Bob = Eve
print (Alice, Bob, Eve)

Output:

23 23 23

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...