WorksheetsPythonFun
Total questions: 8
Worksheet time: 4mins
Every time when we modify the string, Python Always create a new String and assign a new string to that variable.
True
False
Guess the output
a = 5
def func():
____a = 20
____print(a)
print(a)
5
20
None of the above
Error
Guess the output:
a = 5
def func():
____a = 20
____print(a)
print(a)
func()
5
20
20
5
20
20
5
5
Guess the output:
a = 5
def func():
____global a
____a = 20
____print(a)
print(a)
20
5
20
20
Error
Guess the output:
a = 5
def func():
____global a
____a = 20
____print(a)
print(a)
func()
5
20
20
5
20
20
5
5
Guess the output:
a = 5
def func():
____global a
____a = 20
____print(a)
func()
print(a)
20
5
5
20
20
20
5
5
Guess the output:
print("Hey", "There" "i" "am" "Rahul")
Hey There i am Rahul
Hey ThereaamRahul
HeyThereaamRahul
Error
guess the output:
i = 2345
length = 0
for a in i:
____length += 1
print(length)
4
2345
Error
