You are on page 1of 4

Shri. S. H.

Kelkar College Of Arts, Commerce and Science, Devgad


SYBSC IT PYTHON PROGRAMMING SEM III
CORREC
T
QUESTIONS OPTION 1 OPTION 2 OPTION 3 OPTION 4 ANSWER

What is the output when we execute list(“hello”)? [‘h’, ‘e’, ‘l’, ‘l’, ‘o’]. [‘hello’]. [‘llo’]. [‘olleh’] 1

What is the process of tracking down the bugs called? Debugging Bugging Syntaxing. Error-proning 1

What is the return type of function id? void() main() Int() vd() 3
tells you the current tells you the end tells you the file none of the
What is the use of tell() method in python? position within the file position within the file is opened or not mentioned 1

What method is used to create a cursor object? fetch() getcursor() cursor() fetch() 3

What type of data is: a=[(1,1),(2,4),(3,9)]? Array of tuples List of tuples Tuples of lists Invalid type 2
What will be the output of the following Python
code? print("Hello {0!r} and {0!s}".format('foo', Hello {name1} and
'bin')) {name2} Hello ‘foo’ and foo Error Hello and 2
What will be the output of the following Python
code? print("Hello {name1} and Hello {name1} and
{name2}".format(name1='foo', name2='bin')) Hello foo and bin {name2} Error Hello and 1
What will be the output of the following Python code?1 )
>>>str="hello". 2)>>>str[:2]. 3)>>> eh he h e 2
What will be the output of the given code? h “hlm” lm hlm 4
>>>"h"+"lm"
What will be the output of the given code? hon! hon "hon" "hon!" 1
>>>"python!”[3:]
What will be the output of the given code? WXYZ ! WXYz56@ Wxyz WXYz!56 4
>>>print(‘wxyZ!56’.swapcase())
What will be the output of the given code? >>>str = “*” “hello”*”world” hello*world hello world error 2
>>>seq = (“hello”,”world”) >>>print (str.join(seq))
[‘John’, ’is’, ’good [‘John’, ’is', ’good’, [‘John is', ’good [‘John is’, [‘John’, ’is’,
What will be the output of the given code? >>>str = student’] ‘student’,] student’] 'good’, ‘student’] ’good
“John is good student” >>>print (str.split(‘ ‘,2)) student’]
What will be the output of the given code? >>>str1 = e ld l er 2
‘hello world' >>>str2 = ‘computer’ >>>str1 [-2]
What will be the output of the given code? 14 15 13 16 3
>>>string="hello COMPUTER!" >>>len(string)
if there is no
When does the fetchone() method return a None if the query executed if the tuple is next row in the
value? returns none if next row is none none result set 4
When the output you get is not the expected output,
then what kind of error is said to be occurred? Runtime Syntax Semanti exceptional 3
Which error is caused because of Missing parenthese
in expression like 8)? Runtime Syntax Semanti exceptional 2
Which expressions can be the part of formal lanuage
from the following. 1. @ 2. 3+3=6 3. Please 4. NaOH 5
hello there 1,2,3,4. 1,2,4. 1,2,3,4,5 3,5 4

which function is used to converts value into integer? int() integer() Int() Integer() 1

Which function is used to write all the characters? write() writechar() writeall() writechars() 1
Which geometry manager organizes widgets in blocks
before placing them in the parent widget. Position() Grid() Pack() Place() 3

which is the following is the conditional statement Break Pass continues If-else 4

Which keyword is use for function? define def fun function 2

Which modules provide mathematical function? Math math Mathematics mathematics 2


Which of the following are correct variable names .1.
Big_parade 2. More@ 3.76chhayos 4. Class 1 2,4. 1,2,4. 1,4. 1
Which of the following are not keyword in Python. 1.
Exec 2. Lambda 3. Continue 4. Pass 5. Global 6. With
7. structure 1,2,7 2,4,5 1,6 1,7 4
Which of the following are the membership operators
1,2 1,2,3 1,2,3,4 1,3 1
1) in 2) not in 3) is 4) is not
Which of the following are the modes of both writing
and reading in binary format in file? wb wb+ rw a+ 2
Which of the following data type is used to store values
in Key & Value format? Class List Tuple Dictionary 4
which of the following function convert a string to a float
in python? int(x[,base]) float(x) str(x) long(x [,base] ) 2
Which of the following functions checks whether all the isnumeric() swapcase istitle () isspace () 4
characters in a string are whitespaces?
a b c = 1000 2000 a,b,c = 1000, a_b_c =
Which of the following is an invalid statement? abc = 1,000,000 3000 2000, 3000 1,000,000 2

Which of the following is mathematical function? power sqrt add sub 2


Which of the following is not a Python keyword? Break Elif Assert main 4
Which of the following is not a valid mode to open a
file? ab rw r+ w+ 2
Which of the following methods retrieves all the data
after executing a SQL query? fetch() fetchall() fetchone() fetchdata() 2
Which of the following statements are true 1.Python is
high level language 2 all high level languages are
portable 3. Python is interpreted programming
language 4. Low level programs can run on any kind of
computer 1,2,3,4 1,3,4. 1,3 1,2,3 4
Which of the following statements are true for Pass
statement in python
1)The pass statement is a null operation; nothing
happens when it executes.
1 1,2 1,2,3 3 4
2)It is used when a statement is required syntactically
but you do not want any command or code to execute.
3)The pass is also useful in places where your code will
eventually go, but has not been written yet.
Which of the following statements are true
1)Python is platform independent language.
2)Python supports object oriented programming
1,2 1,2,3 2,3 1,2,3,4 4
concept.
3) The python file has .py extension.
4)Python is an open source language.
When you open
a file for writing,
When you open a file if the file exists,
When you open a file for for writing, if the file the existing file
reading, if the file does does not exist, a new is deleted with file is delted
Which of the following statements are true? exist, an error occurs file is created the new file forever 2
The keys of a
The values of a dictionary can be
dictionary can be accessed using Dictionaries Dictionaries are
Which of these about a dictionary is false? accessed using keys values aren’t ordered mutable 1
Which one of the following functions replaces all replace (new, old[,max]) replace (old, replace(old, replace(new, 2
occurrences of old substring in string with new string? new[,max]) new[max) old[max])
Which one of the following is the correct way of calling ret function
a function? function_name() call function_name() function_name() function_name() 1

Which one of these is floor division? // / "" * 1


Which operator is known as String Formatting operator \\ \ % ** 3
in Python?
\ \\ \' / 1
Which operator is used to represent escape character?
List is mutable && Tuple List is immutable && Both are Both are
Which statement is correct....?? is immutable Tuple is mutable Immutable Mutable. 1
Dictionary
Dictionary Values have Duplicate keys are Values should Values have
Which statement is valid no restrictions allowe unique restrictions 1
Which type of operator will we use to access a part of [] <> () 2
the string? {}

You might also like