wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

python quizz Coding club 1

Total questions: 143

Worksheet time: 1hrs 9mins

Name
Class
Date
1.

What are the basic data types in Python?

a)

char, float, array, dict

b)

int, float, str, bool, array, dict

c)

int, float, str, bool, list, tuple, set, dict

d)

int, float, str, boolean, list, tuple

2.

How do you declare a variable in Python?

a)

You declare a variable in Python by using the syntax: variable_name = value.

b)

variable_name : value

c)

let variable_name = value

d)

set variable_name to value

3.

What is the difference between a list and a tuple?

a)

A list can only contain numbers, while a tuple can contain any data type.

b)

A list is defined with {}, while a tuple is defined with []

c)

A list is mutable and defined with [], while a tuple is immutable and defined with ().

d)

A list is immutable and defined with [], while a tuple is mutable and defined with ().

4.

Explain the use of 'if', 'elif', and 'else' statements.

a)

'if' checks a condition, 'elif' checks additional conditions, and 'else' executes if all previous conditions are false.

b)

'if' always executes, 'elif' is optional, and 'else' is mandatory.

c)

'if' checks for errors, 'elif' is for debugging, and 'else' is for logging.

d)

'if' is used for loops, 'elif' is for functions, and 'else' is for imports.

5.

What is a for loop and how is it used in Python?

a)

A for loop is used to define functions in Python.

b)

A for loop is a type of variable in Python.

c)

A for loop is a method for creating classes in Python.

d)

A for loop is a control flow statement that allows code to be executed repeatedly for each item in a sequence.

6.

How do you define a function in Python?

a)

function_name(parameters) =>

b)

create function_name(parameters)

c)

function_name: parameters()

d)

def function_name(parameters):

7.

What is the purpose of the 'return' statement in a function?

a)

The purpose of the 'return' statement is to provide a value from a function to its caller.

b)

To define the function's parameters.

c)

To end the function execution immediately.

d)

To create a loop within the function.

8.

How can you import a module in Python?

a)

Modules can be imported with 'include module_name'.

b)

Import modules using 'load module_name'.

c)

Use the 'import' statement, e.g., 'import module_name'.

d)

Use the 'require' statement, e.g., 'require(module_name)'.

9.

What is the difference between reading and writing a file in Python?

a)

Reading creates data while writing deletes data.

b)

Writing retrieves data from a file.

c)

Reading and writing are the same process.

d)

Reading retrieves data from a file, while writing modifies or creates data in a file.

10.

How do you handle exceptions in Python?

a)

Use try-except blocks to handle exceptions in Python.

b)

Use print statements to debug exceptions in Python.

c)

Ignore exceptions and continue execution.

d)

Use if-else statements to handle exceptions in Python.

11.

What is the purpose of the 'try' and 'except' blocks?

a)

To define functions in Python

b)

To create loops in Python

c)

The purpose of 'try' and 'except' blocks is to handle exceptions and errors in a controlled manner.

d)

To import libraries in Python

12.

Explain the concept of classes in Object-Oriented Programming.

a)

A class in OOP is a blueprint for creating objects, defining attributes and methods.

b)

A class is a method used to manipulate data.

c)

A class is a function that executes code.

d)

A class is a type of variable that holds data.

13.

What is inheritance in Python?

a)

Inheritance in Python is a mechanism where a new class derives properties and behavior from an existing class.

b)

Inheritance is a way to create multiple classes without any relationship.

c)

Inheritance in Python is a method to delete classes from memory.

d)

Inheritance allows a class to inherit only methods, not properties.

14.

How do you create an instance of a class?

a)

Use the class name followed by a semicolon, e.g., 'instance = ClassName;'

b)

Instantiate a class by calling its method directly, e.g., 'instance = ClassName.method()'

c)

Create an instance using the class name without parentheses, e.g., 'instance = ClassName'

d)

Use the class name followed by parentheses, e.g., 'instance = ClassName()'.

15.

What is the purpose of the '__init__' method?

a)

To initialize an object's attributes when creating an instance of a class.

b)

To define a class method for inheritance.

c)

To create a new class in Python.

d)

To execute code when a class is defined.

16.

How can you read a text file line by line in Python?

a)

Use 'open("filename.txt") as file: read(file)' to read the entire file at once.

b)

Use 'open("filename.txt") and file.readlines()' to read lines without a loop.

c)

Use 'file.read_lines()' to read all lines in a list.

d)

Use 'with open("filename.txt") as file: for line in file: print(line)'.

17.

What is the difference between 'open()' with 'r' and 'w' modes?

a)

'w' mode is for appending data to existing files.

b)

The difference is that 'r' mode is for reading (no write access), while 'w' mode is for writing (overwrites existing files or creates new ones).

c)

'r' mode allows both reading and writing.

d)

Both modes create new files if they don't exist.

18.

How do you raise an exception in Python?

a)

raise Exception()

b)

raise Exception('Error message')

c)

throw Exception('Error message')

d)

raise 'Error message'

19.

What is polymorphism in Object-Oriented Programming?

a)

Polymorphism is the ability of different classes to be treated as instances of the same class through a common interface.

b)

Polymorphism is the method of hiding the implementation details of a class.

c)

Polymorphism is the ability to create multiple instances of a class.

d)

Polymorphism refers to the process of combining multiple classes into one.

20.

How can you check the type of a variable in Python?

a)

Use the 'instance()' function.

b)

Use 'get_type()' method.

c)

Use the 'type()' function.

d)

Check the variable with 'var_type()'.

21.

What is the purpose of the 'self' parameter in class methods?

a)

'self' is a placeholder for the class name itself.

b)

'self' is used to create static methods in a class.

c)

'self' is a keyword used to define global variables.

d)

'self' refers to the instance of the class and is used to access variables that belong to the class.

22.

What is a dictionary in Python?

a)

A dictionary is a collection of key-value pairs, where each key is unique.

b)

A dictionary is a type of list that can hold multiple data types.

c)

A dictionary is a method for defining functions in Python.

d)

A dictionary is a way to store data in a sequential manner.

23.

How do you create a virtual environment in Python?

a)

Virtual environments are created automatically when you install Python.

b)

Use 'create env_name' command to set up a virtual environment.

c)

Use 'env_name = virtual()' to create a virtual environment.

d)

Use the command 'python -m venv env_name' to create a virtual environment.

24.

What are the three main programming structures?

a)

Sequence, selection, iteration

b)

Structured, object-oriented, procedural

c)

Java, Python, Visual Basic

d)

Machine, assembly, high-level

25.
What is the Output if the user enters:
Yes
a)
Leave umbrella at home
b)
Take an umbrella
26.

In a Python program , a control structure:

a)

directs the order of execution of the statements in the program

b)

dictates what happens before te program starts and after it terminates

c)

defines program-specific data structures

d)

manages the input and output of control characters

27.

What is the output of the above program ?

a)

Am I here?

b)

Or here ?

c)

Am I here ? Or here ?

d)

Or here ? Or over here ?

28.

If the user inputs : 2<Enter> , what does the following code snippet print ?

a)

Yes

b)

No

c)

May be

d)

Nothing printed

e)

Error

29.

Function range(3) is equivalent to "

a)

range(1,3)

b)

range(0,3)

c)

range(0,3,1)

d)

range(1,3,0)

30.
This operator means that one value is not equal to another value
a)
==
b)
<=
c)
>=
d)
!=
31.

What is the output?

a)

condition

b)

True

c)

Program has a syntax error.

d)

3 > 2

32.

What is the output?

a)

more than 7

b)

more than 23

c)

spam

d)

7

33.

What is the output?

a)

3

b)

3

7

c)

3

5

7

d)

7

34.

What is the output?

a)

True

b)

NIL

c)

True

NIL

d)

True

NIL

NIL

35.

What is the output?

a)

level 3

b)

level 3

level 1

c)

level 3

level 1

NIL

d)

level 3

level 2

level 1

NIL

36.

An If statement can be executed multiple times

a)

FALSE

b)

TRUE

37.

The ‘else’ statement is optional in Python

a)

TRUE

b)

FALSE

38.

It is possible to execute both the statements under if and else at the same time.

a)

TRUE

b)

FALSE

39.

There can be an else statement without an if statement

a)

FALSE

b)

TRUE

40.

The program generates an error message if the "else" statement is not defined

a)

FALSE

b)

TRUE

41.

Python supports (a)   types of loops

42.

What is the output?

a)
Hello world!
b)
Hello world
c)
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
......(repeated continuously)
d)
Error
43.

What is the output if the user types "Python"?

a)
Welcome
b)
Try again!
c)
Error
d)
Enter your password
44.

Why was Python (TM) developed?

a)

To go back to the old way of programming

b)

To create a programming language for students in grade school

c)

To make it easier to learn Java

d)

Python was developed by accident

45.

Python (TM) is owned and managed by

a)

Microsoft (c)

b)

Sun Microsystems (c)

c)

Python (TM) is open source and free to use

d)

Google (c)

46.

Python is ___________ level programming language and is ___________.

a)

High, compiled

b)

High, interpreted

c)

Low, compiled

d)

Low, interpreted

47.

Generally speaking, a low level programming language is easier to read, write and maintain over a high level programming language

a)

True

b)

False

48.

The syntax in Python (TM) is one of the main advantages over other high level programming languages.

a)

True

b)

False

49.

A statement in programming

a)

Expresses an action to be carried out

b)

Always returns results like expressions

c)

Rules controlling how components in a program are combined

d)

An instruction to perform a task, usually one word

50.

A string

a)

carries out an action

b)

the elements of a command

c)

a collection of characters

d)

how elements in a commad are arranged

51.

A block is

a)

a statement including elements of a command

b)

the structure and form of the code

c)

source code that is grouped together

d)

meaning assigned to symbols, characters and words

52.

What symbol comes before a comment?

a)

$

b)

>>

c)

#

d)

!

53.

An exception is

a)

the structure of form of the code

b)

the meaning of the characters and words in the code

c)

the statement that is missing from the instructions

d)

an event occurring during execution of a program which disrupts the flow of the program's instructions

54.

Debugging is

a)

how characters are arranged in a statement

b)

detecting or removing errors from a program

c)

removing viruses from a computer

d)

the meaning of each of the characters and symbols in the program

55.

A disadvantage of Python is it is harder to debug than other higher level programming languages.

a)

True

b)

False

56.

In programming, a (n) _______________ is a value that can change, depending on conditions or on information passed to the program

a)

string

b)

block

c)

instruction

d)

variable

57.

Generally speaking Python (TM) would run _____________ than C++ and take ____________ time to create

a)

faster, less

b)

faster, more

c)

slower, less

d)

slower, more

58.

Since Python (TM) is open source,

a)

Support for using Python (TM) is easy to find

b)

It is free

c)

There is a large catalog of supporting documents

d)

it is a less powerful programming languange

59.

Predict the output of the following code:

x=3

If x>2 or x<5 and x==6:

Print(“ok”)

else:

print(“no output”)

a)

ok

b)

okok

c)

no output

d)

none of above

60.

Which one of the following if statements will not execute successfully?

1) if (1, 2);

print(‘foo’)

2) if (1, 2):

print(‘foo’)

3) if (1):

print( ‘foo’ )

4) if (1);

print( ‘foo’ )

a)

1,4

b)

2

c)

2,4

d)

4

61.

Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a)

20 22 24 26 28

b)

20

22

24

26

28

c)

20 22 24 26 28 30

d)

20

22

24

26

28

30

62.

Which one of the following is incorrect?

a)

The variables used inside function are called local variables.

b)

The local variables of a particular function can be used inside other functions, but these cannot be used in global space.

c)

The variables used outside function are called global variables

d)

In order to change the value of global variable inside function, keyword global is used.

63.

Suppose a function called add() is defined in a module called adder.py. Which of the following code snippets correctly show how to import and use the add() function? Select all that apply.

a)

from adder import add

result = adder.add(2, 3)

b)

from adder import add

result = add(2, 3)

c)

import add from adder

result = add(2, 3)

d)

import adder

result = adder.add(2, 3)

64.

What is the output of the given below program?

print("Know Program".split())

a)

‘Know’, ‘Program’

b)

(‘Know’, ‘Program’)

c)

[‘Know’, ‘Program’]

d)

{‘Know’, ‘Program’}

65.

Find the output of the given Python program?

print(list("abcd".split('')))

a)

[‘a’, ‘’, ‘b’, ‘’, ‘c’, ‘*’, ‘d’]

b)

[‘a’, ‘b’, ‘c’, ‘d’]

c)

[‘abcd’]

d)

[‘abc*d’]

66.

What will be the output of the following Python code?

a={1:"A",2:"B",3:"C"}

a.items()

a)

items()

b)

dict_items([(1,2,3)])

c)

dict_items([(‘A’), (‘B’), (‘C’)])

d)

dict_items([(1, ‘A’), (2, ‘B’), (3, ‘C’)])

67.

Which of the following is correctly evaluated for this function?

  1. pow(x,y,z)  

a)
  1. (x**y) / z

b)
  1. (x / y) * z

c)
  1. (x**y) % z

d)
  1. (x / y) / z

68.

Which one of the following syntaxes is the correct syntax to read from a simple text file stored in ''d:\java.txt''?

a)
  1. Infile = open(''d:\\java.txt'', ''r'')

b)
  1. Infile = open(file=''d:\\\java.txt'', ''r'')

c)
  1. Infile = open(''d:\java.txt'',''r'')

d)
  1. Infile = open.file(''d:\\java.txt'',''r'')

69.

Your Mindset Right now

a)
b)

c)

d)

70.

Create a variable named bike and assign the value Kawasaki H2R to it

a)

bike= Kawasaki H2R

b)

"bike" = Kawasaki

c)

H2R bike= "Kawasaki H2R"

d)

"KawasakiH2R"= bike

71.

Create a variable named x and assign the value of integer 50 to it

a)

x="50"

b)

x: 50

c)

"x"=50

d)

x=50

72.

Display the sum of 5 + 10, using two variables: x and y

a)

x=y y = 10

print(x +y)

b)

x=5 y = x

print(x +y)

c)

x=10 y =5

print(x +y)

d)

x=5 y =10

print(x +y)

73.

Select the illegal variable name

a)

2my-first_name = "John"

b)

my-firstname = "John"

c)

__my-first_name = "John"

d)

my2-first_name = "John"

74.

What is used to print the length of a string

a)

len()

b)

length()

c)

type.legth()

d)

fulllength()

75.

What can we use to get the first character of a string txt= "Banana"

a)

x=txt(0)

b)

x=txt(1)

c)

x=txt[0]

d)

x=txt[1]

76.

What can we use to get the characters from index 2 to index 4 (llo) in txt = "Hello, World"

a)

Options

x= txt[2:4]

b)

x= txt[1:4]

c)

x= txt[2:5]

d)

x= txt[2:6]

77.

Select the right syntax for the if condition

a)

a=10 b=20 if a is greater than b: print("Hello World")

b)

a=10 b=20 if a>b: print("Hello World")

c)

a=10 b=20 if a>b; print("Hello World")

78.

Fill in the blank if a> b: print("True") _____: print("False")

a)

otherwise:

b)

then:

c)

else:

d)

elif:

79.

Select the right syntax to create a function called my_function

a)

def my_function:

b)

define my_function:

c)

func my_function;

d)

create funct my_function;

80.

Inside a function with two parameters, print the first parameter. def my_function(fname, lname): print(________)

a)

my_function

b)

fname

c)

lastname

d)

lname

81.

What will be the output of the following program: fruits = ["apple", "banana", "cherry"] for x in fruits: if x == "banana": print(x)

a)

cherry

b)

apple

c)

apple cherry

d)

banana

82.

The following code will stop the loop if i is 3 Fill in the blanks to perform the same i = 1 ______ i < 6: if i == 3: break i += 1

a)

do while

b)

for

c)

if

d)

while

83.

What will be the output for the following code: for x in range(6): print(x)

a)

0 1 2 3 4 5 6

b)

1 2 3 4 5 6

c)

0 1 2 3 4 5

d)

1 2 3 4 5

84.

What is a library in python?

a)

COLLECTION OF FILES

b)

COLLECTION OF MODULES

c)

IT IS SUBPROGRAM

d)

NAME OF A FILE

85.

exp(),floor()belongs which module?

a)

cmath.py

b)

urlib.py

c)

math.py

d)

statistics.py

86.

What will be the output of the following

from import factorial

print(math.factorial(5))

a)

25

b)

10

c)

120

d)

error bcz factorial is not a module in math

87.

Which of the statements is used to import all names from a module into the current calling module

a)

import

b)

from

c)

dir()

d)

import*

88.
Which of these definitions correctly describes a module?
a)
a) Denoted by triple quotes for providing the specification of certain program elements
b)
b) Design and implementation of specific functionality to be incorporated into a program
c)
c) Defines the specification of how it is to be used
d)
d) Any program that reuses code
89.
Which of the following is not an advantage of using modules?
a)
a) Provides a means of reuse of program code
b)
b) Provides a means of dividing up tasks
c)
c) Provides a means of reducing the size of the program
d)
d) Provides a means of testing individual parts of the program
90.
______ is a string literal denoted by triple quotes for providing the specifications of certain program elements.
a)
a) Interface
b)
b) Modularity
c)
c) Client
d)
d) Docstring
91.
A Python module is a file with the _____ file extension that contains valid Python code.
a)
.pymodule
b)
.py
c)
.module
d)
.pym
92.

Suppose a function called add() is defined in a module called adder.py. Which of the following code snippets correctly show how to import and use the add() function? Select all that apply.

a)

import add from adder

result = add(2, 3)

b)

from adder import add

result = add(2, 3)

c)

from adder import add

result = adder.add(2, 3)

d)

import add

result = adder.add(2, 3)

93.

This code is equivalent to

a)

random.randint(1,11)

b)

random.randint(1,10)

c)

random.randrange(1,11,1)

d)

random.randrange(1,10,1)

94.

Name the keyword used to define a function.

a)

define

b)

def

c)

function

d)

fu

95.

Which one is not true about function?

a)

It breaks the large program into small modules.

b)

It avoids repetition.

c)

It makes code reusable.

d)

It makes the program unorganized.

96.

(a)   which function helps to display all information including docstring ,function name and constant in a module.

97.

random.randrange(6)

a)

0,1,2,3,4,5,6

b)

1,2,3,4,5,6

c)

0,1,2,3,4,5

d)

1,2,3,4,5

98.

random.randint(3,8)

a)

4,5,6,7

b)

3,4,5,6,7

c)

3,4,5,6,7,8

d)

0,1,2,3,4,5,6,7,8

99.

random.random() generates a floating point number between _____ and ______

a)

1 and 2

b)

1 and 0

c)

0 and 1

d)

0 and 10

100.

Which function truncates the fractional part of given number and returns only the integer or whole part.

a)

int()

b)

round()

c)

oct()

d)

hex()

101.

docstrings

a)

single quoted comments

b)

double quoted comments

c)

triple quoted comments

d)

hash tagged comments

102.

What will be the output of the following Python code?

def cube(x):

return x * x * x


x = cube(3)

print (x)

a)

9

b)

3

c)

27

d)

30

103.

What are the two main types of functions?

a)

Custom function

b)

Built-in function & User defined function

c)

User function

d)

System function

104.

What is the purpose of the 'init' method in a Python class?

a)

'init' is a built-in function for error handling.

b)

'init' is used to initialize the attributes of a class instance.

c)

'init' is a method that creates a new class.

d)

'init' is used to define static variables in a class.

105.

How do you handle exceptions in Python?

a)

Exceptions cannot be handled in Python.

b)

Use 'catch' to handle exceptions.

c)

Use 'try' and 'except' blocks to catch exceptions.

d)

Use 'error' to manage exceptions.

106.

What is the output of the following code snippet: print(type([]))?

a)

set

b)

tuple

c)

dictionary

d)

list

107.

What keyword is used to define a function in Python?

a)

method

b)

def

c)

function

d)

func

108.

What symbol is used to pass an arbitrary number of arguments to a Python function?

a)

**

b)

++

c)

*

d)

&

109.

In Python, what does the 'return' statement do in a function?

a)

Exits the function

b)

Deletes the function

c)

Calls another function

d)

Returns a value

110.

Which of the following is a correct way to call a function named 'my_function'?

a)

execute my_function()

b)

call my_function()

c)

my_function[]

d)

my_function()

111.

How do you define a function that takes two parameters, 'fname' and 'lname'?

a)

function my_function(fname, lname)

b)

my_function(fname, lname)

c)

def my_function(fname, lname)

d)

def my_function: fname, lname

112.

What is the correct syntax to return the fourth element in a list named 'fruits'?

a)

fruits[4]

b)

return fruits[3]

c)

fruits.get(4)

d)

return fruits(4)

113.

Which method would you use to add an item to the end of a list named 'items'?

a)

list.add(items, item)

b)

items.append(item)

c)

items.add(item)

d)

items.push(item)

114.

What is the correct way to handle exceptions in Python?

a)

error...catch

b)

try...except

c)

try...catch

d)

do...while

115.

Which of the following is a valid for loop in Python?

a)

loop x in range(5)

b)

for x = 0; x < 5; x++

c)

for x to 5

d)

for x in range(5)

116.

What is the correct syntax for defining a class named 'Vehicle'?

a)

class Vehicle:{}

b)

class Vehicle()

c)

class Vehicle:

d)

class Vehicle[]

117.

If list=[17,23,41,10] then list.append(32) will result

a)

[32,17,23,41,10]

b)

[17,23,41,10,32]

c)

[10,17,23,32,41]

d)

[41,32,23,17,10]

118.

Which of the following python function can be used to add more than one element within an existing list ?

a)

append( )

b)

append_more( )

c)

extend( )

d)

more( )

119.
What output will this code produce?
a)
red
b)
['blue', 'green', 'red']
c)
['red', 'green', 'blue']
d)
error
120.

Please select all correct ways to empty the following dictionary

student = {

"name": "Emma",

"class": 9,

"marks": 75

}

a)

del student

b)

del student[0:2]

c)

student.clear()

121.

Select correct ways to create an empty dictionary

a)

sampleDict = {}

b)

sampleDict = dict()

c)

sampleDict = dict{}

122.

Items are accessed by their position in a dictionary

a)

True

b)

False

123.

Dictionary keys must be immutable

a)

True

b)

False

124.

In Python, Dictionaries are immutable

a)

True

b)

False

125.

_________________ method will not only delete the item from dictionary, but also return the deleted value.

a)

del ( )

b)

pop( )

c)

Clear( )

126.

________________method will returns number of key-value pairs in the given dictionary.

a)

len( )

b)

pop( )

c)

del( )

d)

keys( )

e)

values( )

127.

What is the output of the following list operation

aList = [10, 20, 30, 40, 50, 60, 70, 80]

print(aList[2:5])

print(aList[:4])

print(aList[3:])

a)

[20, 30, 40, 50]

[10, 20, 30, 40]

[30, 40, 50, 60, 70, 80]

b)

[30, 40, 50]

[10, 20, 30, 40]

[40, 50, 60, 70, 80]

c)

None of these

128.

What is the output of the following

aList = [5, 10, 15, 25]

print(aList[::-2])

a)

[15, 10, 5]

b)

[10, 5]

c)

[25, 10]

129.

In Python, list is mutable

a)

False

b)

True

130.

What will be the output of below Python code?

list1=[8,0,9,5]


print(list1[::-1])

a)

[5,9,0,8]

b)

[8,0,9]

c)

[8,0,9,5]

d)

[0,9,5]

131.

Sort () function in list by default sort the values in __________

a)

Ascending order

b)

Decending order

132.

____________function can be used to insert an element/object at a specified index.

a)

extend( )

b)

insert ( )

c)

append( )

133.

___________method adds a single item to the end of the list.

a)

extend( )

b)

append( )

c)

insert( )

134.

What is the maximum length of a Python identifier?

a)

32

b)

16

c)

128

d)

No fixed length is specified

135.

What will be the output of the following code snippet?

print(2**3 + (5 + 6)**(1 + 1))

a)

129

b)

8

c)

121

d)

None of the above

136.

What will be the datatype of the var in the below code snippet?

var = 10

print(type(var))

var = "Hello"

print(type(var))

a)

str and int

b)

int and int

c)

str and str

d)

int and str

137.

How is a code block indicated in Python?

a)

Brackets

b)

Indentation

c)

Key

d)

None of the above

138.

What will be the output of the following code snippet?

print(type(5 / 2))

print(type(5 // 2))

a)

float and int

b)

int and float

c)

float and float

d)

int and int

139.

Which of the following concepts is not a part of Python?

a)

Pointers

b)

Loops

c)

Dynamic Typing

d)

All of the above

140.

Which of the following statements are used in Exception Handling in Python?

a)

Try

b)

Except

c)

Finally

d)

All of the above

141.

Which of the following types of loops are not supported in Python?

a)

For

b)

While

c)

Do-While

d)

None of the above

142.

Which of the following is the proper syntax to check if a particular element is present in a list?

a)

If ele in list

b)

If not ele not in list

c)

Both A and B

d)

None of the above

143.

Which of the following functions converts date to corresponding time in Python?

a)

strptime ( )

b)

strftime ( )

c)

Both A and B

d)

None of the above