Comment your answers below!

Python_Dv's tweet image. Comment your answers below!

Answer: A) hello In Python, the if statement evaluates the truthiness of an expression. An empty string '' or an empty list [] would be considered "falsy," while any non-empty string, including a string containing only the digit '0' like '0', is considered "truthy."


"hello" because the zero is a string, so it's a non-null/"truthy" value. If the zero were an int, it would evaluate to False and then "world" would be printed.


It's A if you understand truthy and falsy values and in Python, any non empty string is a truthy value


Hello,cause that is that


'hello' is the result. The reason is because you are giving it nothing, so it is 0.


hello Because 0 here is a string not an integer so it's = True


hello, the answer is A, because zero have quotate


Hello because in Python any non-empty string is true If "0" is non-empty string.


I guess Answer is 'hello'


>>> if 0: ... print("hello!") ... else: ... print("world!") ... world! >>> if 1: ... print("hello!") ... else: ... print("world!") ... hello!


maybe 90% will not fail on this


As a js learner i'd say A) hello. Cuz a string is evaluated true.


Why would you want to do anything like that? 🙄 I get the coding/mental exercise but that is more like an error statement than a real life application.


United States 트렌드
Loading...

Something went wrong.


Something went wrong.