EXAM 2024 NEWEST EXAM COMPLETE 300 QUESTIONS
WITH DETAILED VERIFIED ANSWERS (100%
CORRECT) /ALREADY GRADED A+
Which of the following is the correct extension of the Python file? - ANSWER: .py
Does python code need to be compiled or interpreted? - ANSWER: Python code is
both compiled and interpreted
Which of the following is used to define a block of code in Python language? -
ANSWER: Indentation
Which keyword is used for function in Python language? - ANSWER: def
Which of the following functions is a built-in function in python?
randint( )
print()
sqrt()
factorial() - ANSWER: print()
Which of the following is not python's built-in function
hash()
zip()
re()
bin() - ANSWER: re()
Which of the following is not a core data type in Python programming?
Number, String, Boolean
List, Tuple
Dict, Set
Clsss - ANSWER: Clsss
What is the output of print str[2:5] if str = 'Python Programming'? - ANSWER: tho
What is the output of print str[2: ] if str = 'Python Programming'? - ANSWER: thon
Programming
What is the output of print len( [ 'abcd', 786 , 2.23, 'john', 10 ] )? - ANSWER: 5
What will be the output of the following Python code?
str = 'abcd'
, for i in str:
print(i.upper()) - ANSWER: A B C D
What will be the output of the following Python code?
str = 'abcd'
for i in range(len(str)):
print(i) - ANSWER: 0 1 2 3
What will be the output of the following Python code?
for i in ['a', 'b', 'c', 1, 2, 3][::-1]:
print (i) - ANSWER: 3 2 1 c b a
What will be the output of the following Python code?
for i in ['a', 'b', 'c', 1, 2, 3][1:3]:
print (i) - ANSWER: b c
What is the output of the following Python's code fragment:
mylist = [-12, -43, 55, 67, -32, 12, -2]
print( mylist[-2] ) - ANSWER: 12
What is the content of mylist in the following Python's code fragment?
mylist = [-12, -43, 55, 99, -32, 12, -2]
mylist.insert(2, 67) - ANSWER: [-12, -43, 67, 55, 99, -32, 12, -2]
What output of result in following Python program?
list1 = [1,2,3,4]
list2 = [2,4,5,6]
result1 = list1 + list2
for i in result1:
print(i) - ANSWER: 1 2 3 4 2 4 5 6
What is the output of the following python code fragment?:
list1 = [1, 2, 5, 7]
list2 = [4, 2, 5, 3]
print([i for i in list1 if i not in list2]) - ANSWER: [1, 7]
What output in following Python program?
list1 = [1,2,3,4]
list2 = [2,4,5,6]
list3 = [2,6,7,8]
result1 = list1 + list2
result2 = list2 + list3
for i in result1:
if i not in result2:
print(i) - ANSWER: 1 3
Assume, you are given two lists: