wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PYTHON

Total questions: 50

Worksheet time: 29mins

Name
Class
Date
1.

¿What is Python?

a)

Python is a high-level, interpreted, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.

b)

Is a high-level, interpreted, general-purpose programming language.

c)

Is a high-level, programming language. I

d)

Al the above.

2.

Is python compiled language ?

a)

Yes

b)

No

c)

No Idea

3.

What will be the output of :

a = 4.5

b = 2

print( a//b )

a)

2.0

b)

2.5

c)

2.25

d)

Error

4.

What command is used to insert 6 in a list "L" at 3rd position?

a)

L.insert(3,6)

b)

L.add(3,6)

c)

L.insert(2,6)

d)

L.append(2,6)

5.
If you want more than one option for your code, what do you use (after if)?
a)
elif
b)
else
c)
ifif
6.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
7.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
8.
What will the output be from the following code?
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
9.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
10.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
11.

Which of the following operator is used to compare operator -

a)

!=

b)

<=

c)

==

d)

all of the above

12.

Is python an interpreter or compiler programming language?

a)

Compiler

b)

Interpreter

13.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
14.

What is the Python built-in function to converts a number to a string?

a)

str()

b)

int()

c)

parseInt()

d)

convert

15.
What will the output be from the following code?
print("Hello" + "world" + "today")
a)
Helloworldtoday
b)
Hello world today
c)
"Hello" "world" "today"
d)
SyntaxError
16.

What will the output be from the following code?

print Hello world!

a)

Hello world!

b)

SyntaxError

c)

Hello world

d)

print Hello world!

17.
The character that must be at the end of the line for if, while, for etc.
a)
:
b)
;
c)
.
d)
,
18.
What is syntax?
a)
Syntax is the word used to describe an error
b)
Syntax is the rules of the programming language
c)
It is used to read information
d)
It is used to output information 
19.

What does the following code do? myAge = int (myAge)

a)

Converts the var (variable) myAge to a string

b)

Converts the var (variable) myAge to a integer

c)

Converts the var (variable) myAge from a integer to a string

d)

Converts the var (variable) myAge to if statement

20.
What syntax can you use to insert a line break between strings so that they appear over multiple lines?
a)
/
b)
\n
c)
\l
d)
n
21.

people = ["John", "Rob", "Bob"]

print (people[1])

what would this result be?

a)
John
b)
Rob
c)
Bob
22.

people = ["John", "Rob", "Bob"]

print (people[-1])

what would this result be?

a)
John
b)
Rob
c)
Bob
23.

people = ["John", "Rob", "Bob"]

print (people[4])

what would this result be?

a)
John
b)
Rob
c)
Bob
d)
Error
24.
What is a variable?
a)
A box(memory location) where you store values
b)
a type of graphics
c)
Data type
d)
a type of memory
25.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

26.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
27.

¿Con que extensión guardamos los archivos de Phyton?

a)

.Doc

b)

.Py

c)

Solo con el nombre

d)

.Python

28.

Cual de estas afirmaciones es la correcta:

a)

Un programa no tiene instrucciones.

b)

Las instrucciones no tienen un orden especifico.

c)

Cada instrucción en un programa se ejecuta en un orden.

d)

Ninguna es correcta.

29.

¿Cuál de las siguientes opciones es correcta?

a)
b)
c)
d)
30.

Selecciona las variables escritas de forma incorrecta:

a)

numero1

b)

numero 2

c)

perroGrande

d)

9coches

31.

¿Qué se muestra por pantalla?

a)

edad

b)

(edad)

c)

Tu edad es: 20

d)

20

32.

¿Qué se muestra por pantalla?

a)

7

b)

12

c)

resultado

d)

El resultado es 7

33.

¿Qué se muestra por pantalla?

a)

8

b)

resultado

c)

"resultado"

d)

15

34.

¿Qué se muestra por pantalla?

a)

4

b)

resultado

c)

nada

d)

8

35.

¿Qué se muestra por pantalla?

a)

3

b)

4

c)

resultado

d)

12

36.

¿Qué se muestra por pantalla?

a)

La edad que la persona haya escrito + 5

b)

edad + 5

c)

12 + 5

d)

Edad5

37.

¿Qué se muestra por pantalla?

a)

5

b)

20

c)

10

d)

resultadoFinal

38.

¿Qué se muestra por pantalla?

a)

No es mayor

b)

Es mayor

c)

"Es mayor"

d)

Nada

39.
¿Qué tipo de datos permite el uso de datos sin decimales?
a)
int
b)
float
c)
true
d)
false
40.
¿Qué operador aritmético se utiliza para obtener el resultado de elevar un número a una potencia?
a)
/
b)
%
c)
//
d)
**
41.
¿A qué operación corresponde el siguiente estructura?
                        variable ==expresión
a)
comparación
b)
asignación
42.
What does the APPEND procedure do in the following code:
a)
Adds Liverpool to the beginning of the list
b)
Replaces Bristol with Liverpool
c)
Replaces Manchester with Liverpool
d)
Adds Liverpool to the end of the list
43.
In the following code, "city" is an example of a what?
a)
List
b)
Loop
c)
Variable
d)
Array
44.

Each item in a list has an index. What is the first index in a Python list?

a)

0

b)

1

c)

a

d)

A

45.
What output will this code produce?
a)
4
b)
2
c)
3
d)
5
46.

What will the output be from the following code?

print(3+4)

a)

3+4

b)

7

c)

SyntaxError

d)

print(3+4)

47.
print("12"*3)
What would this print?
a)
36
b)
121212
c)
24
d)
12*3
48.

What will the output be from the following Python code?

Print("Hello world!")

a)

NameError

b)

Hello world!

c)

"Hello world"

d)

Print(Hello world!)

49.

What is the Python built-in function to converts a number to a string?

a)

str()

b)

int()

c)

parseInt()

d)

convert

50.

Which of these is correct Python conditional statement?

a)

IF answer == "Yes":

b)

if answer == "Yes"

c)

if answer == "Yes":

d)

if answer = "yes":