Computer Science
What is the output of the following lines of code?
if int('zero') == 0 :
print ("zero")
elif str(0) == 'zero' :
print (0)
elif str(0) == '0' :
print (str(0))
else:
print ("none of the above")
Related Questions
What is the output produced by the following code?
x = 1 if x > 3 : if x > 4 : print ("A", end = ' ') else : print ("B", end = ' ') elif x < 2: if (x != 0): print ("C", end = ' ') print ("D")
What is the error in following code? Correct the code:
weather = 'raining' if weather = 'sunny' : print ("wear sunblock") elif weather = "snow": print ("going skiing") else : print (weather)
Find the errors in the code given below and correct the code:
if n == 0 print ("zero") elif : n == 1 print ("one") elif n == 2: print ("two") else n == 3: print ("three")
What is following code doing? What would it print for input as 3?
n = int(input( "Enter an integer:" )) if n < 1 : print ("invalid value") else : for i in range(1, n + 1): print (i * i)