UNIT-1 Introduction To Python Programming
UNIT-1 Introduction To Python Programming
Answer: a
Answer: d
Answer: d
Answer: b
Answer: a
Answer: a
Answer: d
c) underscore and ampersand are the only two special characters allowed
Answer: a
a) abc = 1,000,000
d) a_b_c = 1,000,000
Answer: b
a) __init__ b) in c) it d) on
Answer: b
Answer: A
programming interfaces is
Answer: A
Answer: D
Answer: A
Answer: C
a) Low level Language b) Middle Level Language c) High Level Language d) All the above
Answer: C
Answer: D
c)You can write multi-line comments in Python using triple quotes, either ''' or """.
Answer: A
a)Variable name can start with an underscore. b)Variable name can start with a digit.
Answer:A
Answer:B
Answer:C
Answer:C
numbers = [2, 3, 4]
print(numbers)
Answer: C
print(3 >= 3)
Answer:B
Answer:A
30. What is used to define a block of code (body of loop, function etc.) in Python?
Answer: C
Answer: d
32. Given a function that does not return any value, What value is thrown by default when
executed in shell.
Answer: d
33.Following set of commands are executed in shell, what will be the output?
>>>str="hello"
>>>str[:2]
>>>
a) he b) lo c) olleh d) hello
Answer: a
Answer: a
Answer: a
36.n python we do not specify types,it is directly interpreted by the compiler, so consider the
following operation to be performed.
>>>x = 13 ? 2
objective is to make sure x has a integer value, select all that apply (python 3.xx)
Answer: d
apple = mango
Answer: b
def example(a):
a = a + '2'
a = a*2
return a
>>>example("hello")
a) indentation Error
c) hello2
d) hello2hello2
Answer: a
a) list
b) dictionary
c) array
d) tuple
Answer: a
41.In order to store values in terms of key and value we use what core datatype.
a) list
b) tuple
c) class
d) dictionary
Answer: d
c) ‘3\’
d) ”’That’s okay”’
Answer: c
tom
dick
harry
a) print(”’tom
\ndick
\nharry”’)
b) print(”’tomdickharry”’)
c) print(‘tom\ndick\nharry’)
d) print(‘tom
dick
harry’)
Answer: c
>>>grade1 = 80
>>>grade2 = 90
a) 85
b) 85.1
c) 95
d) 95.1
Answer: b
c) print(‘hello-‘ + ‘how-are-you’)
Answer: c
a) int
b) bool
c) float
d) None
Answer: a
c) Error
d) Hello and
Answer: a
d) Error
Answer: b
c) Error
Answer: c
print('{:,}'.format(1112223334))
a) 1,112,223,334
b) 111,222,333,4
c) 1112223334
d) Error
Answer: a