Which of the following round()
function calls will run without errors?
What is the output of the following Python code?
print('xyyzxxyxyy'.lstrip('xyy'))
What will be the output of the following Python code?
>>> str1 = 'hello'
>>> str2 = ','
>>> str3 = 'world'
>>> str1[-1:]
What will be the output of the following Python code?
import datetime
d=datetime.date(2017,06,18)
print(d)
What is the output of the following code?
x = 8
y = 8.0000
if x == y:
print("If block")
else:
print("Else block")
What will be the output of the following Python code?
d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.values():
print(x)
What will be the output of the following Python code snippet?
print('abcd'.translate({'a': '1', 'b': '2', 'c': '3', 'd': '4'}))
What will the below python code print:
name = "Rishi"
age = 29
print("Hi " + name + ", " + age + " years old")
What is the correct syntax to generate random integers between 1 and 10?
Find the output of the following code:
a = 100
b = 0
try:
print(a / b)
except:
print("Zero division error")
print("success")