Computer Science
Carefully look at the following code and its execution on Python shell. Why is the last assignment giving error ?
>>> a = 0o12
>>> print(a)
10
>>> b = 0o13
>>> c = 0o78
File "<python-input-41-27fbe2fd265f>", line 1
c = 0o78
^
SyntaxError : invalid syntax
Related Questions
What will be the output produced by following code ?
>>> print(print("Hola"))
What will be the output produced by following code ?
>>> print (print ("Hola", end = ""))
Predict the output
a, b, c = 2, 3, 4 a, b, c = a*a, a*b, a*c print(a, b, c)
The id( ) can be used to get the memory address of a variable. Consider the adjacent code and tell if the id( ) functions will return the same value or not(as the value to be printed via print() ) ? Why ?
[There are four print() function statements that are printing id of variable num in the code shown on the right.num = 13 print( id(num) ) num = num + 3 print( id(num) ) num = num - 3 print( id(num) ) num = "Hello" print( id(num) )