Python 1
Python 2
Python 3
Python 4
100

What file extension do python files have?

.py

100

Which variable type stores decimal numbers?

float

100

What is a collection of objects inside "[" and "]" called?

List

100

What is an parameter?

the variable listed inside the parentheses in the function definition

200

What does the function input() do, and what type of object does it return?

allows the user to type input. returns a string

200

What is the python function to get the length/size of a object?

len()
200

What def() keyword creates? 

a function

200

What will be the value of the following Python expression?

(4 + 3) % 5

2

300

To use modules (libraries)  in another Python script, you must first ______  the module.

import

300

What are these symbols called?

+,  ==,  - ,  / ,  // ,  *,  **, %

operators

300

Where does indexing start?

at 0

300

To remove an element from the list we use which Python command?

remove()

400

To comment a line in python, which symbol do you use?

# or """   """

400

Which type of error would arise here?


a  = 5.888.4

SyntaxError

400

What is python file extension?

.py

400

To add a new element to a list we use which Python command?

append()

500

Which two flow-control statements loop through a set of statements, if a condition continues to be True?

"while" and "for"

500

number = 5

for i in range (number):

 print(i)


Which one is a variable in this code?

number and i

500

What will be the output of the following Python code?

x = 'abcd'
for i in range(len(x)):

    print(i)

0 1 2 3

500

What will be the output of the following Python code?

>>>list = [1, 3, 9 , 0]

>>>print(list[2])




 

9