Knowledge check.

- Choose one best answer from given 4 choices for each questions.
- Review before submit as you wont get a chance to review after submit.
- Max Time for quiz is 30 mins and Exam is 90 mins.
- Login is not required for an exam or a quiz.
- By submitting you formally acknowledge and accept terms and conditions mentioned here.

Question Number 1

Which of the following statements is true about the multiline code?

Question Number 2

Give the output of the following code snippet:
class MyClass:
    def __init__(self,Name = "",Age=0):
        self.Name = Name
        self.Age = Age

    def GetName(self):
        return self.Name

    def SetName(self, Name):
        self.Name = Name    
    
    def GetAge(self):
        return self.Age

    def SetAge(self,Age):
        self.Age = Age
            
    def __str__(self):
        return "{0} is aged {1}.".format(self.Name,self.Age)

class Anna(MyClass):
    def __init__(self,Name = "X", Age=0):
        self.Name = Name
        self.Age = Age
        self.Id = 1001

    def GetID(self):
        return self.Id
        
JohnRecord = MyClass()
AnnaRecord = MyClass()
print(AnnaRecord.GetID())

Question Number 3

What are the key components of the server side for which the tutorials are provided for?

Question Number 4

Which of the following commands is used to obtain the host name for a host address?

Question Number 5

Give the output of the following code snippet:
class MyClass:
    def __init__(self, Name="John", Age=40):
        self.Name = Name
        self.Age = Age

    def GetName(self):
        return self.Name

    def SetName(self, Name):
        self.Name = Name

    def GetAge(self):
        return self.Age

    def SetAge(self, Age):
        self.Age = Age

    def __str__(self):
        return "{0} is aged {1}.".format(self.Name,self.Age)

JohnRecord = MyClass()
AnnaRecord = MyClass("Amy", 44)
print(JohnRecord)

Question Number 6

Give the output of the following code snippet:
## LibTest.py
def SayHello(Name):
    print("Hello",Name)
    return

def SayAge(Age):
    print("Age : ", Age + 10)
    return

>>> LibTest.SayAge(10)

Question Number 7

Which of the following command line option in python if used to perform additional optimization by removing doc-strings?

Question Number 8

Give the output of the following code snippet in the python shell window:
>>> var = 10
>>> if ( 4 == 0b100):
	var //= 3
	var **= 2
	print(var)

Question Number 9

Which method is used to delete files by supplying the name of the file to be deleted as the argument?

Question Number 10

Give the output of the following code snippet:
class MyClass:
    Sum = 0
    def Calc(self,Val1 = 10, Val2=20):
        Sum = Val1 * Val2/10
        print(Sum)    

MyExp = MyClass(20)
MyExp.Calc(40)

Question Number 11

Give the output of the following code snippet:
class MyClass:
    def __init__(self, *args):
        self.Input = args

    def __add__(self, Other):
        Output = MyClass(self)
        Output.Input = self.Input + Other.Input
        return Output

    def __str__(self):
        Output = ""
        for Item in self.Input:
            Output += Item
        return Output
        
Value1 = MyClass("Red", "Green")
Value2 = MyClass("Blue", "Purple")
Value3 = MyClass("Black", "White")
Value4 = MyClass("Yellow", "Brown")
Value = Value1 + Value2
print("{0} + {1} = {2}".format(Value1, Value2, Value3))

Question Number 12

Give the output of the following code snippet in the python shell window:
>>> def Test(Arg = str(123)+ str(45)):
	print(Arg)

	
>>> Test(111)

Question Number 13

Give the output of the following code snippet:
List = [1,2,'Three',4.5]
print(List[0] + List[3])

Question Number 14

Give the output of the following code snippet:
var = 1

while (var <= 10):
    if( var != 2):
       pass
       var += 2
else:
    break
    var -= 1
    
print(var)

Question Number 15

Give the output of the following code snippet:
string = "This is a test program that is to test string functions"
Result = string.replace("test","new")
print(Result)

Question Number 16

What are the features of the python debugger?

Question Number 17

Give the output of the following code snippet :
>>> myvar = 0o16
>>> hexa(myvar)

Question Number 18

Give the output of the following code snippet:
string = "Hello World"
Result = string.index("w")
print(Result)

Question Number 19

Which library needs to be imported in Python to work with sockets?

Question Number 20

Which of the following are some of the forms of MIME which are used when creating a message for an email?

Question Number 21

Give the output of the following code snippet:
var = 1

for Arg in range(1,3):
    if(Arg <= 3):
        pass
        var += 5

print(var)

Question Number 22

Give the output of the following code snippet : The contents of the file is a string 'Hello World'

file = open("Test.txt","w")
file.write("Program")
file.seek(10,0)
string = file.tell()
file.close()
print (string)

Question Number 23

Give the output of the following code snippet :
>>> myvar = 2.55e-3 + 1.25e1
>>> myvar

Question Number 24

Which of the following statements are true about the Twisted Matrix library?

Question Number 25

To uncomment multiple lines of code at one, highlight those lines and select :

Question Number 26

Which of the following statements are true about the pydoc, also known as, Python Module Documentation?

Question Number 27

Give the output of the following code snippet in the python shell window:
>>> def Test(Arg = str(123)):
	print(Arg + 123)

	
>>> Test()

Question Number 28

Give the output of the following code snippet :
>>> myComp1 = 3 + 5j
>>> myComp2 = 4 + j
>>> myComp3 = myComp1 + myComp2
>>> myComp3.imag

Question Number 29

Which method shows how to use a data storage methodology called JavaScript Object Notation (JSON)?

Question Number 30

Which method of the os module can be used to create directories in the current directory?

Question Number 31

Give the output of the following code snippet:
List = ["Hello","World"]*2 + ["World"]
Result = 0
List.pop("Hello")

for value in List[3]:
        Result += 2
        if(value == 'o'):
            Result -= 3
        else :
            Result += 5

print(Result)

Question Number 32

Which option allows unbuffered binary input for stdout and stderr devices?

Question Number 33

Give the output of the following code snippet:
class MyClass:
    age = 0
    def __init__(self,age = 10):
        self.age = age + 20
    def Greet(self):
        print("Hello")   
    def PrintAge(self):
        print(self.age)    

MyClass.age = 10
MyInit = MyClass()
MyInit.PrintAge()

Question Number 34

Give the output of the following code snippet:
List = ["Hello"]*2 + ["World"]
Result = 0
List.insert(1,"Hello")

for value in List:
        Result += 1
        List.clear()

print(Result)

Question Number 35

Give the output of the following code snippet :
import socket
print(socket.gethostbyname("localhost"))

Question Number 36

All the elements that comprise the class are called as :

Question Number 37

Give the output of the following code snippet:
## LibTest.py
def SayHello():
    print("Hello")
    PrintAge(10)
    return

def PrintAge(Age):
    print(Age + 10)
    return 

>>> import LibTest
>>>SayAge()

Question Number 38

Give the output of the following code snippet:
List = ["Hello","World"]*2 + ["!"]*2
Result = 0
List2 = List.copy()
List2.append("!")

for value in List[2]:
        Result += 1
        if(value == 'H'):
            Result -= 2
        else :
            Result += 2
            
print(len(List))

Question Number 39

Give the output of the following code snippet:
List = [1,2,4,5.5]
Result = 0
List.remove(4)

for value in List:
    Result += value

print(Result)

Question Number 40

Give the output of the following code snippet : The contents of the file 'Test.txt' is a string 'Hello World' and 'Test2.txt' does not exist.

file = open("Test.txt","r")
file2 = open("Test2.txt","w+")
file.seek(0,0)
string = file.read()
file2.write(string)
file2.seek(0,0)
string = file2.read()
file.close()
file2.close()
print (string)

Question Number 41

Give the output of the following code snippet :
>>> myvar = 0o16
>>> binary(myvar)

Question Number 42

Give the importance of the -h command line option in python :

Question Number 43

Give the output of the following code snippet:
var = 1

for Arg in "Hello":
    var += 1
print(var)
    
    

Question Number 44

Give the output of the following code snippet:
class MyClass:
    def __init__(self, Name="John"):
        self.Name = Name
        self.Age = Age

    def GetName(self):
        return self.Name

    def SetName(self, Name):
        self.Name = Name

    def GetAge(self):
        return self.Age

    def SetAge(self, Age):
        self.Age = Age + 10

    def __str__(self):
        return "{0} is aged {1}.".format(self.Name,self.Age)

JohnRecord = MyClass()
AnnaRecord = MyClass("Amy", 44)
print(JohnRecord)

Question Number 45

The date and time obtained can be converted to a more readable format using which command?

Question Number 46

Give the output of the following code snippet:
string = "Hello World"
Result = string.zfill(15)
print(Result)

Question Number 47

Give the output of the following code snippet:
class MyClass:
    age = 10
    def __init__(self,age = 10.5):
        self.age = age + 20  
    def PrintAge(self):
        print(self.age)    

MyClass.age = 20
print(MyClass.age)

Question Number 48

Give the output of the following code snippet in the python shell window:
>>> def Test :
        print("Hello")

>>>Test()

Question Number 49

Give the output of the following code snippet :
>>> myvar = 0b100
>>> octa(myvar)

Question Number 50

Give the output of the following code snippet:
var = 0
string = "Hello World"

for Arg in string:
    if(Arg == 'o' or Arg = 'l'):
        var += 2
    else :
        var -=1
print(var)

Question Number 51

Give the output of the following code snippet : The contents of the file 'Test.txt' is a string 'Red Blue' , 'Test2.txt' contains the string ' Green Yellow' and 'Test3.txt' contains the string ' Black White'.
file = open("Test.txt","a+")
file2 = open("Test2.txt","r+")
file3 = open("Test3.txt","w+")
string = file.read()
file3.seek(0,2)
file3.write(string)
string = file2.read()
file3.seek(0,2)
file3.write(string)
val = file3.tell()

file.close()
file2.close()
file3.close()
print (val)

Question Number 52

Which of the following statements is true regarding compile time errors?

Question Number 53

Which of the following provides the ability to examine classes, functions and keywords to determine their purpose and capabilities?

Question Number 54

Which of the following statements are true regarding Tuples in Python?

Question Number 55

Which of the following list functions adds an entry to the end of the list?

Question Number 56

Give the output of the following code snippet:
#!/usr/bin/python

MyTuple = ("Red","Blue")
MyTuple = MyTuple.__add__(("Green",10))
MyTuple = MyTuple.__add__(("Yellow",20.5))
print(MyTuple[3])

Question Number 57

Which testing stage is associated with validating that your application meets speed, reliability and security requirements?

Question Number 58

Give the output of the following code snippet:
#!/usr/bin/python

DList = {"B": 10, "B": 20,"C1" : 30}
DList2 = {"A": 5,"B" : 40}
DList3 = {"C": 50, "C": 60}

DList.update({"C1" : "50"})
del DList["B"]
print(DList["B"])

Question Number 59

Give the output of the following code snippet:
List = ["Hello","World"]*2 + ["!"]*2
Result = 0
List2 = List.copy()
List2.append("!")

for value in List:
        Result += 1
        if(value == '!'):
            Result -= 2
        else :
            Result += 2
            

print(len(List2))

Question Number 60

Give the output of the following code snippet :
>>> myInt = float("5678") + int("24")
>>> myInt

Question Number 61

Which of the following denotes the connection used to access a combination of a host address and a port ?

Question Number 62

Which of the following statements are true regarding the use of platform independent libraries?

Question Number 63

Which of the following statements are true about dictionaries in Python?

Question Number 64

Give the output of the following code snippet : The contents of the file 'Test.txt' is a string 'Red Blue' , 'Test2.txt' contains the string ' Green Yellow' and 'Test3.txt' contains the string ' Black White'.
file = open("Test2.txt","r+")
file2 = open("Test3.txt","a+")
string = file.read()
file2.write(string)
file2.seek(5,0)
string1 = file2.read(5)
file.close()
file2.close()
print (string1)

Question Number 65

Give the output of the following code snippet:
string = "Hello World"
Result = string.index("o")
print(Result)

Question Number 66

Give the output of the following code snippet in the python shell window:
>>>def  Func(Arg :"Default value")
        print(Arg)
>>>Func()

Question Number 67

Which of the following is true about the library elementsoap?

Question Number 68

Give the importance of the -S command line option in python :

Question Number 69

Which of the following is a library to make sound work with your Python application?

Question Number 70

Which part of the email contains the information about the sender and the recipient information?

Question Number 71

Give the output of the following code snippet :
>>> myint = str("Hello")
>>>myint

Question Number 72

Give the output of the following code snippet:
class MyClass:
    def PrintList1(*args):
        for count,Item in enumerate(args):
            if(count == 0):
                print((Item[0]))
                

    def PrintList2(**kwargs):
        for count,Item in kwargs.items():
            if(count == 0):
                print(Item[1]+Item[1])
                
MyClass.PrintList1(B="Red")
MyClass.PrintList2("Green","Yellow")

Question Number 73

Give the output of the following code snippet:
var = 1

for Arg in range(1,3):
    if(Arg == 3):
        continue
        var += 5

print(var)

Question Number 74

Give the output of the following code snippet:
Formatted = "A {0} {1} {2}."
print(Formatted.format("Hello", "World", "program"))

Question Number 75

Give the output of the following code snippet:
var = 0
string = "Hello"

for Arg in string:
    if(Arg == 'l'):
        var +=2
        continue
        string = "World"
    else:
        var -=1
print(var)

Question Number 76

Give the output of the following code snippet in the python shell window:
>>> def TestFun(Arg):
	print(Arg)
	
>>> TestFun(100)

Question Number 77

Give the output of the following code snippet :
>>> myvar = 1.25e-2
>>> myvar +=2
>>> type(myvar)

Question Number 78

Give the output of the following code snippet:
List = ["Hello","World"]*2 + ["World"]
Result = 0
List.pop(3)

for value in List:
        Result += 2
        if(value == 'o'):
            Result -= 3
        else :
            Result += 5

print(Result)

Question Number 79

Give the output of the following code snippet:
List = [1,2,'Three',4,5.5]
Result = 0

for value in List:
    Result += List[value]

print(Result)

Question Number 80

Give the output of the following code snippet:
class MyClass:
    def __init__(self,Age,Name="John"):
        self.Name = Name
        self.Age = Age

    def GetName(self):
        return self.Name

    def SetName(self, Name):
        self.Name = Name

    def GetAge(self):
        return self.Age

    def SetAge(self, Age):
        self.Age = Age + 10

    def __str__(self):
        return "{0} is aged {1}.".format(self.Name,self.Age)

JohnRecord = MyClass(50)
JohnRecord.SetAge(10)
AnnaRecord = MyClass("Amy", 44)
print(JohnRecord.GetAge())

Question Number 81

Give the output of the following code snippet : The contents of the file is a string 'Hello World'
file = open("Test.txt","a+")
file.write("Program")
file.seek(10,1)
string = file.read(2)
file.close()
print (string)

Question Number 82

Give the output of the following code snippet:
string = "Hello World"
Result = string.find("Hello")
Result1 = string.index("World")
print(Result1 + Result)

Question Number 83

Give the output of the following code snippet:
List = ["Hello","World"]*2 + ["World"]
Result = 0
List.pop(3)

for value in List[3]:
        Result += 2
        if(value == 'o'):
            Result -= 3
        else :
            Result += 5

print(Result)

Question Number 84

Which of the following commands is used to exit python?

Question Number 85

Give the output of the following code snippet in the python shell window:
>>> def Test() 
        print("Hello")

>>>Test()

Question Number 86

Give the output of the following code snippet :
>>> myComplex = 3 + 2j
>>> myComplex

Question Number 87

Give the output of the following code snippet:
string = "\r\n"
Result = string.isspace()
print(Result)

Question Number 88

Give the output of the following code snippet in the python shell window:
>>> var = 10
>>> var = (~var)
>>> var

Question Number 89

Give the output of the following code snippet :
value = 10

if(value == 10//4 or 10//2):
    
else:
    print(value + 10)

Question Number 90

Give the output of the following code snippet:
class MyTest :
    var = 0

NewInst = MyTest()
print(NewInst.var + 1)

Question Number 91

Which demonstrates a special kind of list that never contains duplicate entries?

Question Number 92

Give the output of the following code snippet:
var = 0
string = "Hello"

for Arg in string:
    if(Arg == 'l'):
        var += 1
print(var)

Question Number 93

Give the output of the following code snippet:
List = [1,2,4,5.5,7,8.25]
Result = 0
List.remove(5.5)

for value in List:
    Result += value
    List.append(3)
    break

print(Result)

Question Number 94

Give the output of the following code snippet :

print(socket.gethostbyname("localhost"))

Question Number 95

Which of the following statements are true about the Python IDLE?

Question Number 96

Give the output of the following code snippet:
## LibTest.py
def SayHello(Name):
    print("Hello",Name)
    return

def SayAge(Age):
    print("Age : ", Age + 10)
    return

>>> from LibTest import SayAge
>>> LibTest.SayAge(10)

Question Number 97

Give the output of the following code snippet :
>>> myvar = 1.25e-2
>>> myvar

Question Number 98

Give the output of the following code snippet:
List = ["Hello","World"] % 2+ ["World"]
Result = 0
List.insert(1,"Hello")

for value in List:
     List.clear()
     Result += 2

print(Result)

Question Number 99

What are the two components of an email?

Question Number 100

Give the output of the following code snippet:
List = ["Hello","World"]*2 + ["World"]* 2
Result = 0
List.remove("Hello")

for value in List[3]:
        Result += 1

print(Result)

Question Number 101

Which of the following statements are true about the Komodo Edit IDE?

Question Number 102

Give the output of the following code snippet : The contents of the file is a string 'Hello World'

file = open("Test.txt","a+")
file.write("Program")
file.seek(0,0)
string = file.read(5)
file.close()
print (string)

Question Number 103

Which of the following statements are true about PyInstaller?

Question Number 104

Give the output of the following code snippet:
List = ["Hello","World"]*2 + ["!"]*2
Result = 0
List.pop(1)

for value in List:
        Result += 2
        if(value == '*'):
            Result -= 2
        else :
            Result += 2

print(Result)

Question Number 105

Give the output of the following code snippet:
List = [1,2,'Three',4.5]
print((List[1:1] +(List[2:3]))[3])

Question Number 106

What are the key components of the server side for which the tutorials are provided for?

Question Number 107

Give the output of the following code snippet in the python shell window:
>>> var = not 50
>>> var

Question Number 108

Give the output of the following code snippet:
string = "Hello World"
print(string{4} + string[0])

Question Number 109

Give the output of the following code snippet:
## LibTest.py
def SayHello(Name):
    print("Hello",Name)
    return

def SayAge(Age):
    print("Age : ", Age + 10)
    return

>>> import LibTest
>>> LibTest.SayAge(10)

Question Number 110

Give the output of the following code snippet:
class MyTest:
    var = 0
    def SayHello():
        print("Hello")

NewInst = MyTest()
NewInst2 = MyTest()
NewInst.var = 2
NewInst2.var = 3
MyTest.SayHello()

Question Number 111

Which is a library for adding enhanced font functionality to a PIL based application?

Question Number 112

Give the output of the following code snippet :
>>> myvar = 0x152
>>> myvar == 338

Question Number 113

Give the output of the following code snippet:
## LibTest.py
def SayHello(Name):
    print("Hello",Name)
    return

>>> import LibTest
>>> LibTest.SayHello("Arya")

Question Number 114

Give the output of the following code snippet :
>>> myvar = 10
>>> myvar += 0x10
>>> myvar += 0o10
>>> myvar

Question Number 115

Give the output of the following code snippet:
#!/usr/bin/python

MyTuple = ("Red","Blue")
MyTuple2 = (1,2,3,("Pink","Brown"))
MyTuple = MyTuple.__add__(("Green",10))
MyTuple = MyTuple.__add__(("Yello",20.5))
print(MyTuple[2]+MyTuple2[3])

Question Number 116

Give the output of the following code snippet :
>>> myvar = 1.25e2
>>> myvar

Question Number 117

Give the output of the following code snippet:
var = 1
string = "Hello World"

for Arg in string:
    if(Arg == 'o' or 'l' and 'd'):
        var +=1
if( Arg == 'd'):
    var -= 1
print(var)

Question Number 118

Which are the basic features offered by Roundup issue Tracker without any extra installation process?

Question Number 119

What are the components of an email address?

Question Number 120

Give the output of the following code snippet:
class MyClass:
    def PrintList1(**kwargs):
        for count,Item in kwargs.items():
            print("{0}. {1}".format(count,Item))

MyClass.PrintList1(1A="Red",2A="Blue")

Question Number 121

What are the key components of the client side for which the tutorials are provided for?

Question Number 122

Give the output of the following code snippet : The contents of the file 'Test.txt' is a string 'Red Blue' , 'Test2.txt' contains the string ' Green Yellow' and 'Test3.txt' contains the string ' Black White'.
file = open("Test.txt","r")
file2 = open("Test3.txt","b+")
string = file.read()
file2.seek(1,0)
file2.write(string)
string1 = file2.read(10)
string = file2.tell()
file.close()
file2.close()
print (string1)

Question Number 123

Which of the following is used to indicate a multiline comment?

Question Number 124

Which of the following looping structures is not available in Python?

Question Number 125

Which of the following statements is true regarding the import statement?

Question Number 126

What are the key components of the server side for which the tutorials are provided for?

Question Number 127

Give the output of the following code snippet in the python shell window:
>>> var = "Hello" in "Hello World"
>>> var

Question Number 128

Give the output of the following code snippet:
class MyClass:
    def __init__(self,Name = "",Age=0):
        self.Name = Name
        self.Age = Age

    def GetName(self):
        return self.Name

    def SetName(self, Name):
        self.Name = Name    
    
    def GetAge(self):
        return self.Age

    def SetAge(self,Age):
        if(Age > 30):
            self.Age = Age + self.Age
        else:
            self.Age = 20
            
    def __str__(self):
        return "{0} is aged {1}.".format(self.Name,self.Age)

class Anna(MyClass):
    def __init__(self,Name = "X", Age=0):
        self.Name = Name
        self.Age = Age
        self.Id = 1001

    def GetID(self):
        return self.Id
        
JohnRecord = MyClass()
AnnaRecord = Anna()
print(AnnaRecord)

Question Number 129

Give the output of the following code snippet:
## LibTest.py
def SayHello():
    print("Hello")
    PrintAge()
    return

def PrintAge():
    Age = 10
    print(Age + 10)
    SayHello()
    return

>>> import LibTest
>>>SayHello()

Question Number 130

Give the output of the following code snippet in the python shell window:
>>> var  = 4
>>> var **=2
>>> var //=10
>>> var

Question Number 131

Which of the following types of files are not to be written when performing a module import?

Question Number 132

Which module contains everything needed to create the message envelope and send it?

Question Number 133

Give the output of the following code snippet : The contents of the file 'Test.txt' is a string 'Red Blue' , 'Test2.txt' contains the string ' Green Yellow' and 'Test3.txt' contains the string ' Black White'.
file = open("Test.txt","r+")
file2 = open("Test2.txt","w+")
file3 = open("Test3.txt","w+")
string = file.read()
file3.seek(0,2)
file3.write(string)
string = file2.read()
file3.seek(0,2)
file3.write(string)
file3.seek(0,0)
val = file2.tell()

file.close()
file2.close()
file3.close()
print (val)

Question Number 134

Give the output of the following code snippet :
>>> myvar = 10
>>> oct(myvar)

Question Number 135

Give the output of the following code snippet:
string = "123456"
Result = string.isupper()
print(Result)

Question Number 136

Which of the following statements are true about constructors in Python?

Question Number 137

Which of the following statements are true about the Twisted Matrix library?

Question Number 138

Give the output of the following code snippet:
#!/usr/bin/python

MyTuple = ["Red","Blue"]
MyTuple = MyTuple.__add__((20,10))
print(MyTuple)

Question Number 139

Give the output of the following code snippet : The contents of the file is a string 'Hello World'

file = open("Test.txt","w")
file.write("Program")
print (file.read())

Question Number 140

Which of the following are examples of bug tracking sites that can be used with Python?

Question Number 141

Which option is used to display the python version number and then exit?

Question Number 142

Give the output of the following code snippet:
Formatted = "{:*^15.3f}"
print(Formatted.format(3000))

Question Number 143

Give the output of the following code snippet:
string = "Hello#World Program"
Result = string.split("#")[1]
print(Result)

Question Number 144

Give the output of the following code snippet in the python shell window:
>>> def TestFun():
	print("Hello")
	
>>> def TestFun2():
	print("World")

>>> TestFun2("Hello") 

Question Number 145

Give the output of the following code snippet in the python shell window:
>>> var = !100 && 0
>>> var

Question Number 146

Give the output of the following code snippet:
string = "Hello World"
Result = string.isdigit()
print(Result)

Question Number 147

Give the output of the following code snippet : Assume the input given in 10.
try :
    value = int(input("Enter value:"))
except ValueError:
        print("Invalid")
else :
    if(value %2 == 0 ):
        print(value)
    else :
        print(0)

Question Number 148

Give the output of the following code snippet:
from collection import Counter

List = [1,2,4,5] + [11,10]
Result = 0
List2 = List.copy()
List2.reverse()
List3 = List+ List2

ListCount= Counter(List3)
print(ListCount.get(1))

Question Number 149

Give the output of the following code snippet in the python shell window:
>>> def Test(Arg = 100):
	Arg **=2
	Arg //=3
	print(Arg+1)

	
>>> Test(50)

Question Number 150

Give the output of the following code snippet:
var = 1

for Arg in range(1,3):
    if(Arg != 3):
        var += 5
        break

print(var)

Question Number 151

Give the output of the following code snippet : The contents of the file 'Test.txt' is a string 'Red Blue' , 'Test2.txt' contains the string ' Green Yellow' and 'Test3.txt' contains the string ' Black White'.
file = open("Test.txt","a+")
file2 = open("Test2.txt","a+")
file3 = open("Test3.txt","w+")
string = file.read()
file3.seek(0,2)
file3.write(string)
string = file2.read()
file3.seek(0,0)
file3.write(string)
val = file3.tell()

file.close()
file2.close()
file3.close()
print (val)

Question Number 152

For the open() function to access a file, what is the action taken if the buffering value is negative?

Question Number 153

Give the output of the following code snippet in the python shell window:
>>> def Test(Arg = str(123)):
	print(Arg + str(45))

	
>>> Test()

Question Number 154

Give the output of the following code snippet:
var = 0
string = "Hello World"

for Arg in string:
    if(Arg == ''):
        var +=2
if( Arg == ''):
    var -= 5

else :
    var += 5
print(var)

Question Number 155

Which of the following is true about the library elementtree?

Question Number 156

To comment out multiple lines of code at one, highlight those lines and select :

Question Number 157

Based on how they are made, which of the following type of error is hardest to find?

Question Number 158

Based on how they are made, most programming language breaks the types of errors that occur into which of the following types?

Question Number 159

Give the output of the following code snippet:
var = 0

for Arg in range(1,5):
        var += 5
else:
    continue
    var //= 2
print(var)

Question Number 160

Give the output of the following code snippet:
string = "1234 World"
Result = string.isdigit()
print(Result)

Question Number 161

Give the output of the following code snippet : The contents of the file 'Test.txt' is a string 'Red Blue' , 'Test2.txt' contains the string ' Green Yellow' and 'Test3.txt' contains the string ' Black White'.
file = open("Test.txt","r+")
file2 = open("Test2.txt","r+")
file3 = open("Test3.txt","w+")
string = file.read()
file3.seek(0,2)
file3.write(string)
string = file2.read()
file3.seek(0,2)
file3.write(string)
file3.seek(10,0)
string3 = file3.read(5)

file.close()
file2.close()
file3.close()
print (string3)

Question Number 162

The Komodo Edit provided by Python is a/an :

Question Number 163

Which of the following statements are true about the Komodo Edit IDE?

Question Number 164

Which of the following commands is used to obtain the host address for a hostname?

Question Number 165

Which of the following commands can be used to execute an application from python shell window?

Question Number 166

Give the output of the following code snippet in the python shell window:
>>> def Test(Arg = str(123)+ str(45)):
	print(str(123))

	
>>> Test()

Question Number 167

Give the output of the following code snippet : The contents of the file 'Test.txt' is a string 'Red Blue' and 'Test2.txt' contains the string ' Green Yellow'.

file = open("Test.txt","r")
file2 = open("Test2.txt","a")
string = file.read()
file2.write(string)
file2.seek(0,0)
string1 = file2.read()
file.close()
file2.close()
print (string1)

Question Number 168

Which of the following operators interact with the individual bits in a number?

Question Number 169

Which window automatically indents some types of text?

Question Number 170

What is IDLE?

Question Number 171

Give the output of the following code snippet in the python shell window:
>>>def TestFun(Arg = 10):
	return(Arg+1)
               return(Arg+2)

>>>TestFun()

Question Number 172

Give the output of the following code snippet:
class MyTest 
    var = 0

NewInst = MyTest()
print(NewInst.var + 1)

Question Number 173

Give the output of the following code snippet:
var = 1

for Arg in range(1,2):
        var += 2
else:
        var **= 2
print(var)

Question Number 174

Give the output of the following code snippet:
var = 0
string = "Hello"

for Arg in string:
    if(Arg == 'l'):
        var +=2
        pass
        print(string)
        
    else:
        var -=1
print(var)

Question Number 175

Which of the following statements are true about the pdoc utility in Python?

Question Number 176

Which of the following statements are true about the class variables?

Question Number 177

Give the importance of the -S command line option in python :

Question Number 178

Which is the library that helps you create Simple Object Access Protocol (SOAP) connections to Web services providers?

Question Number 179

Give the output of the following code snippet:
var = 1

for Arg in range(1,10):
    if(Arg != (10%3)):
        var += 2
        break
    elif (Arg != (20%3)):
        var **= 2
print(Arg)

Question Number 180

Which of the following statements are true for a single line comment in the edit window?

Question Number 181

Give the output of the following code snippet :
>>> myvar = 0x152
>>> myvar == 152

Question Number 182

Give the output of the following code snippet:
#!/usr/bin/python

DList = {"B": "Red", "C": "Yellow","C1" : 20}
DList2 = {"A": "Blue","D" : 10}
print(DList2.keys())

Question Number 183

Which of the following statements is true about the multiline code?

Question Number 184

Give the output of the following code snippet:
string = "This is a test program that is to test string functions"
Result = string.search("prog")
print(Result)

Question Number 185

Give the output of the following code snippet : The contents of the file 'Test.txt' is a string 'Red Blue' , 'Test2.txt' contains the string ' Green Yellow' and 'Test3.txt' contains the string ' Black White'.
file = open("Test.txt","r+")
file2 = open("Test2.txt","r+")
file3 = open("Test3.txt","w+")
string = file.read()
file3.seek(0,2)
file3.write(string)
string = file2.read()
file3.seek(0,2)
file3.write(string)
file3.seek(0,0)
val = file2.tell()

file.close()
file2.close()
file3.close()
print (val)

Question Number 186

Give the output of the following code snippet:
var = 1

while (var != (10%4)):
        var += 1
else :
    var += 2
print(var)

Question Number 187

Give the output of the following code snippet : The contents of the file 'Test.txt' is a string 'Red Blue' and 'Test2.txt' contains the string ' Green Yellow'.

file = open("Test.txt","r")
file2 = open("Test2.txt","r+")
file.seek(5,0)
string = file.read()
file2.write(string)
string = file2.tell()
file.close()
file2.close()
print (string)

Question Number 188

Give the output of the following code snippet:
var = 0

for Arg in range(1,5):
        var += 5
else:
    break
print(var)

Question Number 189

Give the output of the following code snippet:
string = "Hello World"
Result = string.len()
print(Result)

Question Number 190

What does the color Purple in the Python IDLE indicate?

Question Number 191

Give the output of the following code snippet:
string = "Hello World"
print(string[0 : 3])

Question Number 192

Give the output of the following code snippet:
string = "Hello World"
Result = string.zfill(12)
Result1 = Result.center(15,"*")
Result2 = Result.lower()
print(Result2)

Question Number 193

Which method is used to change the current file position?

Question Number 194

Which of the following statements is true about the Header part of the email?

Question Number 195

Give the output of the following code snippet:
List = [1,2,'Three',4.5]
print(List[0] +(List[1:3]))

Question Number 196

Give the output of the following code snippet : Assume the input given in 5.
try :
    value = int(input("Enter number from 1 to 10:"))
exception ValueError :
        print("Invalid number")
else:
    if(value > 0 ) and (value <= 10):
        print(value)
    else :
        print("Invalid value")

Question Number 197

Give the output of the following code snippet in the python shell window:
>>> var = 20
>>> var += ~0b100
>>> var

Question Number 198

Which method provides a useful method for determining how you can access a particular location?

Question Number 199

Give the output of the following code snippet : The contents of the file 'Test.txt' is a string 'Red Blue' , 'Test2.txt' contains the string ' Green Yellow' and 'Test3.txt' contains the string ' Black White'.
file = open("Test.txt","r+")
file2 = open("Test2.txt","w+")
file3 = open("Test3.txt","w+")
string = file.read()
file3.seek(0,2)
file3.write(string)
string = file2.read()
file3.seek(0,2)
file3.write(string)
val = file3.tell()

file.close()
file2.close()
file3.close()
print (val)

Question Number 200

Give the output of the following code snippet:
#!/usr/bin/python

MyTuple = ("Red")
MyTuple = MyTuple.__add__(("Green"))
MyTuple = MyTuple.__add__(("Yellow"))
print(MyTuple)

Question Number 201

Give the output of the following code snippet in the python shell window:
>>> var = 0
>>> if var == (10 > 20):
	print(var + 20)

Question Number 202

Give the output of the following code snippet:
var = 0
string = "Hello"

for Arg in string:
    if(Arg == 'l'):
        var +=2
        continue
        var = 0
    else:
        var -=1
print(var)

Question Number 203

Give the output of the following code snippet:
class MyTest :
    var = 0

NewInst = MyTest()
print(NewInst -> var)

Question Number 204

Which of the following list functions is used to add items from an existing list to the current list?

Question Number 205

Give the output of the following code snippet in the python shell window:
>>> var = 10
>>> if ( var == 20 or var == 10):
	print(100)

Question Number 206

Give the output of the following code snippet : The contents of the file 'Test.txt' is a string 'Red Blue' and 'Test2.txt' contains the string ' Green Yellow'.

file = open("Test.txt","w+")
file2 = open("Test2.txt")
string = file.read()
file2.write(string)
file2.seek(0,1)
string1 = file2.tell()
file.close()
file2.close()
print (string1)

Question Number 207

Give the output of the following code snippet in the python shell window:
>>> def Test(Arg = 25):
	Arg **=2
	Arg //=3
	print(Arg+1)

	
>>> Test()

Question Number 208

Give the output of the following code snippet:
List = [1,2,4,5.5]
Result = 0
List.append("Hello")

for value in List:
    Result += value

print(Result)

Question Number 209

Give the output of the following code snippet :
>>> myvar = 0o16
>>> hex(myvar)

Question Number 210

Give the output of the following code snippet:
#!/usr/bin/python

DList = {"A": "Blue", "B": "Red", "C": "Yellow"}
print(DList["A"])

Question Number 211

Give the output of the following code snippet:
## LibTest.py
def SayHello(Name):
    print("Hello",Name)
    return

>>> import LibTest.py
>>> LibTest.SayHello("Arya")

Question Number 212

Which is the following is the correct way to run a python program using command line?

Question Number 213

Give the output of the following code snippet in the python shell window:
>>> if var = 0 :
        print("Hello World")

Question Number 214

Which of the following identity operators is used to identify if the type of value of the left and right operands are different?

Question Number 215

Give the output of the following code snippet:
string = "This is a test program that is to test string functions"
Result = string.index("prog",10,30)
print(Result)

Question Number 216

Give the output of the following code snippet:
List = [1,2,4,5.5]
Result = 0

for value in List:
    Result += List[value]

print(Result)

Question Number 217

Give the output of the following code snippet :
>>> myvar = 0b100
>>> myvar == 100

Question Number 218

Give the output of the following code snippet :
>>> myint = int(123) + int(234)
>>> myint

Question Number 219

Which of the following is a library for performing screen captures?

Question Number 220

What is the upgraded version of the Komodo Edit IDE?

Question Number 221

Give the output of the following code snippet:
var = 0
string = "Hello"

for Arg in string:
    if(Arg == 'l'):
        var +=2
    else:
        var -=1
        break
print(var)

Question Number 222

Give the output of the following code snippet:
List = [1,2,4,5.5]
Result = 0
List.delete(5)

for value in List:
    Result += value

print(Result)

Question Number 223

What is the act of storing each version of an application in a separate place so that changes can be undone or redone as needed?

Question Number 224

Give the output of the following code snippet :
>>> myvar = 1 > 2
>>> myvar

Question Number 225

Give the output of the following code snippet in the python shell window:
>>> var = 8
>>> var %=3
>>> var **=3
>>> var //=10
>>> var

Question Number 226

Give the output of the following code snippet:
List = [1,2,'Three',4.5]
print(List[0] + List[2])

Question Number 227

Give the output of the following code snippet in the python shell window:
>>> var = 10
>>> if ( var == 20 or var == 10);
	print(100)

Question Number 228

Which of the following unary operators in python is used to invert the bits of a number?

Question Number 229

Give the output of the following code snippet :
import sys

Result = True
try :
    raise ValueError
except (ValueError):
        sys.exit()

finally:
    Result = False
    print(Result)

print("End")

Question Number 230

Give the output of the following code snippet:
var = 0
string = "Hello"

for Arg in string:
    if(Arg == 'o'):
        var +=2
    elif (var != 1):
        var -=1
        break
print(var)

Question Number 231

Give the output of the following code snippet : Assume the file is not present
import sys

try :
    File = open('Test.txt')
except IOError as e:
    print("Error opening file " + "Error number : {0} ".format(err.errno) +
          "Error text :{0}".format(e.strerror))

else:
    print("File opened")
    File.close()

Question Number 232

Give the output of the following code snippet:
#!/usr/bin/python

MyTuple = ("Red","Blue")
MyTuple2 = (1,2,3)
MyTuple = MyTuple.__add__(("Green",10))
MyTuple = MyTuple.__add__(("Yellow",20.5))
print(MyTuple[2]+MyTuple2[2])

Question Number 233

Give the output of the following code snippet : The contents of the file is a string 'Hello World'

file = open("Test.txt","a+")
file.write("Program")
file.seek(10,3)
string = file.read(2)
file.close()
print (string)

Question Number 234

Give the output of the following code snippet:
class MyClass:
    def __init__(self, *args):
        self.Input = args

    def __add__(self, Other):
        Output = MyClass()
        Output.Input = self.Input + Other.Input
        return Output

    def __str__(self):
        Output = ""
        for Item in self.Input:
            Output += Item
            Output += " "
            return Output
        
Value1 = MyClass("Red", "Green")
Value2 = MyClass("Blue", "Purple")
Value3 = Value1 + Value2
print("{0} + {1} = {2}".format(Value1, Value2, Value3))

Question Number 235

Which of the following statements are true regarding the use of platform independent libraries?

Question Number 236

Give the output of the following code snippet:
class MyClass:
    def PrintList2(**kwargs):
        for count,Item in kwargs.items():
            while(count == 'A'):
                print("{0}".format(Item[0]))
            else :
                print("{0}".format(Item[0]+Item[0]))

MyClass.PrintList2(A="Red")
MyClass.PrintList2(A="Green",B="Yellow")

Question Number 237

An RDBMS relies on which special language to access the individual records in a database?

Question Number 238

Give the output of the following code snippet:
class MyClass:
    def PrintList2(**kwargs):
        for count,Item in kwargs.items():
            while(count == 'A'):
                print("{0}".format(Item[0]))
                break
            else :
                print("{0}".format(Item[0]+Item[0]))
                continue

MyClass.PrintList2(A="Red")
MyClass.PrintList2(A="Green",B="Yellow")

Question Number 239

What are the main features of Komodo IDE?

Question Number 240

Give the output of the following code snippet:
class MyClass:
    def PrintList2(**kwargs):
        for count,Item in kwargs.items():
            if(count == 'A'):
                print("{0}".format(Item[0]))
            else :
                print("{0}".format(Item[0]+Item[0]))

MyClass.PrintList2(A="Red")
MyClass.PrintList2(A="Green",D="Yellow")

Question Number 241

Which of the following statements are true about the finally clause?

Question Number 242

Give the output of the following code snippet : Assume the inputs given for value1 = 0 and value2 = 20.
try :
    value1 = int(input("Enter first value:"))
    value2 = int(input("Enter second value:"))
    Result = value1/value2
except (ValueError):
        print("Enter whole number")
except (KeyboardInterrupt):
        print("Interrupt detected")
except (ArithmeticError):
        print("Undefined Math error")
except (ZeroDivisionError):
        print("Cannot divide by zero")
else :
        print(Result)

Question Number 243

Give the output of the following code snippet:
string = "Hello World"
print(string(0 - 3))

Question Number 244

Give the output of the following code snippet:
class MyClass:
    def __init__(self,Age=0):
        self.Age = Age

    def GetAge(self):
        return self.Age

    def SetAge(self,Age):
        if(Age > 30):
            self.Age = Age + self.Age
        else:
            self.Age = 20

    def __str__(self):
        return "{0} is aged {1}.".format(self.Name,self.Age)

JohnRecord = MyClass()
JohnRecord.SetAge(30)
AnnaRecord = MyClass()
print(JohnRecord.GetAge())

Question Number 245

Which of the following are true with regards to modules in Python?

Question Number 246

What is the act of keeping track of the changes that occur in an application between application releases to the production environment?

Question Number 247

Give the output of the following code snippet :
value = 10

if(value == (10//5)):
    print(value)

elif (value != 10//2):
    print(value - 1)

Question Number 248

Which of the following string functions is used to convert all the characters in a string to lowercase?

Question Number 249

Give the output of the following code snippet :
>>> myvar = 0x16
>>> bin(myvar)

Question Number 250

Give the output of the following code snippet : The contents of the file 'Test.txt' is a string 'Red Blue' , 'Test2.txt' contains the string ' Green Yellow' and 'Test3.txt' contains the string ' Black White'.
file = open("Test3.txt","w+")
file2 = open("Test2.txt","a+")
string = file.read()
file2.seek(5,0)
file2.write(string)
string1 = file2.read(5)
string = file2.tell()
file.close()
file2.close()
print (string)

Question Number 251

Which function provides the same functionality as find(), but searches backward from the end of the string instead of the beginning?

Question Number 252

Which colour in the Python IDLE indicates that you have typed a command?

Question Number 253

Which of the following statements is true regarding compile time errors?

Question Number 254

Which method can be used to change the current directory?

Question Number 255

Give the output of the following code snippet:
string = "Hello World"
Result = string.find("w")
print(Result)