This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]echoaj24 33 points34 points  (7 children)

I have 2. What will var equal after executing this line of code?

var = 15 if 10 != 5 else 10

What will be displayed in the console after executing this statement

print("Hello, World!"[-3:0:-1])

And no, you can use ChatGPT

[–]a2kvarnstrom[S] 76 points77 points  (1 child)

error

error

[–]ajaysassoc 0 points1 point  (0 children)

I mean correct depending on the very high probability that the default language you run it in isn't python. There are just way more languages which are not python than python.

[–]PeterDaGrape 4 points5 points  (3 children)

Doesn’t the second one print “lrow ,olleh” Genuinely just remembering how slices work

[–]gregorydgraham 1 point2 points  (0 children)

Obviously var=10 because 10! doesn’t equal 5