What is the answer to this expression, 22 % 3 ?
What will be the output of the following Python code?
>>>str="hello"
>>>str[:2]
>>>
What is pass in Python?
Given the following Python code:
s = 'apple'
x = s.find('p')
y = s.find('f')
z = s.find(' ')
print(x + y + z)
Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop(1)?
Is the following Python code valid?
>>> a=2,3,4,5
>>> a
What will be the output of the program?
from sys import*
name = argv
variable = raw_input("hello world")
print name
What will be the output of the following Python code?
i = 5
while True:
if i%0O9 == 0:
break
print(i)
i += 1
Which of the following is the use of id() function in python?
Find the output of the following code:
class StudentFail(Exception):
def __init__(self, msg):
super().__init__(msg)
class Student:
def __init__(self, marks):
self.marks = marks
def pass_fail(self):
if self.marks < 35:
raise StudentFail('Student is Fail')
else:
print("Student is passed")
s1 = Student(35)
s1.pass_fail()