Time : 450 sec
1. Python can be used as interpreter
1. true
2. false
3. both
4. none
2. What is the use of pass?
1. It does nothing
2. pause the code for 1 second
3. avoid execution of code.
4. none
3. pickling is process of converting the object into serialized form ?
1. true
2. false
3. both
4. none
4. lamda is one line function
1. true
2. false
3. both
4. none
5. How to do shallow copy of an object?
1. shallow(x)
2. copy.copy(x)
3. shallow.copy(x)
4. none
6. How to do deep copy of an object?
1. copy.deepcopy(x)
2. deep(x)
3. deepcopy(x)
4. none
7.How to create constructor?
1. def __init__(self, arguments):
//code
//code
2. init(arguments):
//code
//code
3. constructor(arguments):
//code
//code
4. none
8. How to import another python files in current files?
1. import filename
2. _include fliname
3. _require filename
4. _import filename
9. How to convert string to int?
1. int('string_number');
2. num('string_number');
3. decimal('string_number');
4. digit('string_number');
10. How to convert int to string?
1. str(number);
2. string(number);
3. tostring(number);
4. convertString(number);
11.How to reverse the string?
1. stringname[::-1]
2. strrev(stringname);
3. reverse(stringname);
4. none
12. How to get character from particular position of string?
1. stringfind(“c”);
2. stringposition(“c”);
3. stringplace(“c”);
4. none
13.How to generate random number in python?
1. randint(0,100)
2. random(number);
3. rand(1,100);
4. none
14. How to print the output in python?
1. Use print
2. use echo
3. use outout
4. none
15. what is the output?
>>> import array
>>> a= [1, 2, 3]
>>> print a[-3]
>>> import array
>>> a= [1, 2, 3]
>>> print a[-3]
1. 1
2. 2
3. 3
4. none