What is the expected behavior of the following code?

What is the expected behavior of the following code?

x = 8 ** (1/3)

y = 2. if x < 2.3 else 3.

print(y)
A . it outputs 2.0
B . it outputs 2. 5
C . the code is erroneus and it will not execute
D . it outputs 3.0

Answer: A

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments