wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

pytohn

Total questions: 83

Worksheet time: 45mins

Name
Class
Date
1.

¿Cuál de las siguientes opciones es correcta?

a)
b)
c)
d)
2.

¿Qué se muestra por pantalla?

a)

edad

b)

(edad)

c)

Tu edad es: 20

d)

20

3.

¿Cuál de las siguientes opciones es una variable de tipo Float?

a)

-7.12

b)

5

c)

'8.2'

d)

10.4

4.

¿Qué es Python?

a)

Una serpiente

b)

Un lenguaje de programación

c)

Un programa de Software

d)

Un cuento

5.

Python es

a)

Una serpiente

b)

Un lenguaje de programación

6.

¿Qué pasa cuando escribes el texto verde?

print ('Hola Mundo')

a)

Nada

b)

Le mandas un mensaje sms a todo el mundo

c)

Muestra en pantalla Hola Mundo

d)

Muestras en pantalla 'Hola Mundo'

7.

What is the output of this code

a)

8

b)

13

c)

It gives an error

d)

6

8.

What line of code will generate an error?

a)

1

b)

2

c)

3

d)

4

9.

What will be the output of this code?

a)

5

b)

6

c)

7

d)

8

10.

What will be the result of this code?

a)

1

b)

2

c)

3

d)

4

11.

Which of these examples show the correct way to write a list?

a)

fruit = apple, banana, pear, cherry

b)

fruit=['apple','banana','pear','cherry']

c)

fruit = ('apple', 'banana', 'pear', 'cherry')

d)

fruit=['apple'+'banana'+'pear'+'cherry']

12.

What type of variables does this list contain?

OneD = ['Niall','Zayn','Liam','Harry','Louis']

a)

Integer

b)

Float

c)

String

d)

Boolean

13.

Which of the following commands will print all the items of this list:

fruits = ["apple", "banana", "pear", "strawberry"]

a)

print(fruit)

b)

print(fruits)

c)

print("fruits")

d)

print[fruits]

14.

One list may contain data from different types:

MyList = ["Yellow", 2, 3, "Blue"]

a)

True

b)

False

15.

It is possible to do many things with a list in Python. Which of the following CANNOT be done?

a)

Add an item

b)

Concatenate two lists

c)

Remove an item

d)

Decide which items are the most importants

16.

What is the smallest number of elements that a list can contain?

a)

0

b)

1

c)

2

d)

-1

17.
Which is the best way to get started with Python?
a)
Tonny IDE
b)
Thonny DEI
c)
Thonny IDE
d)
Python PRO
e)
Python novice
18.

Which of these keywords is fake?

a)

False

b)

None

c)

Finally

d)

Repeat

e)

Continue

19.
How many types of comments are in Python?
a)
1
b)
2
c)
3
d)
4
e)
69
20.
Which operator do we use to assign a value to a variable?
a)

()

b)

Símbolo más

c)

/

d)

Símbolo igual

e)

{}

21.
Which of these literals is fake?
a)
Binary
b)
Decimal
c)
Hexadecimal
d)
Octal
e)
Octacimal
22.
Which command do you use to print a text?
a)
print
b)
printf
c)
printp
d)
scanf
e)
prints
23.
Which identifier is incorrect?
a)
score
b)
return
c)
name1
d)
convert_to_string
e)
highest_score
24.
How do you open a comment of 1 line in Python?
a)
@
b)
#
c)
$
d)
//
e)
/*
25.
Which is a boolean option?
a)
(FALSE)
b)
Not true
c)
Maria
d)
15.68
e)
Boolean
26.
Which is the first program you make in python?
a)
Hello World
b)
An indie videogame
c)
A web
d)
An IA
e)
A rpg videogame
27.

Which of the following is a invalid Identifier?

a)

score

b)

pedro22

c)

highest_score

d)

@core

e)

return_value

28.
Which of the following is a Python keyword?
a)
mountain
b)
else
c)
score
d)
Pedro
e)
RPG
29.
Which is the comment in this code?
a)
6
b)
9
c)
num1
d)
num2
e)
# declare and initialize two variables
30.
Which Python Numeric Literals is missing?
a)
Decimal
b)
gigacimal
c)
dectal
d)
Floating-hemalexa
e)
Pedro Sanchez
31.
Can we use any text editing software to write a python script file?
a)
Yes, we just have to save it with the .py extension
b)
No, because it cannot be saved with the .py extension.
c)
Yes, we just need to save it with any extension.
d)
No, this is impossible
e)
Tilted towers
32.
What is the keyword used to define a function in Python?
a)
def
b)
classes
c)
fore
d)
if (not)
e)
while (not)
33.
Which of the following is NOT a variable type in Python?
a)
STR
b)
int
c)
list
d)
DEC
e)
float
34.

A literal in Python is:

a)

Variable that do not change in value during the execution of the program.

b)

Data type that represent a single value.

c)

Function integrated into the language.

d)

Keyword that have a special meaning in Python.

e)

None of them

35.
Which is the correct way to use the print function without using variables?
a)
print "Text"
b)
print =("Text")
c)
print("Text")
d)
print(Text)
e)
print"(Text)"
36.
Can identifiers be keywords?
a)
Yes
b)
No
c)
Identifiers doesn't exist
d)
We don't need to use identifiers, they are useless
e)
There are not identifiers in Python
37.

Which of this words is a keyword?

a)

imput

b)

caracol

c)

RAM

d)

and

e)

5+5

38.
How can you place a Comment in your code
a)
You have to place a *// before the comment to write it
b)
You have to place a # before the comment to write it
c)
You can't write comments
d)
You have to place :) before the comment to write it
e)
No
39.
How can you assign a value to a variable in Python?
a)
Using the assignment =
b)
Using the assignment +
c)
Using the assignment set
d)
Using the assignment []
e)
Using the assignment {
40.
Is Python free?
a)
Only the old versions
b)
No, is always avaliable by purschase
c)
Yes
d)
Python has a free trial and then you can buy the complete version
e)
Python is only available for big companies and is so expensive the new features
41.
Which extension we need to use to save the program to edit it with a script file?
a)
.sf
b)
.py
c)
.yp
d)
.fs
e)
.pth
42.
Which of this rules are not true for identifiers?
a)
Identifiers can't be a keyword
b)
You can’t use the whitespaces
c)
You can use special symbols( @,#,etc)
d)
It can have a sequence of letters and digits
e)
It's a convention to start an identifier with a letter rather than _.
43.
How many types of comments exist?
a)
1
b)
2
c)
3
d)
4
e)
33
44.
Which of the following is a correct way to declare a variable in Python?
a)
variable_name = 5
b)
5 = variable_name
c)
variable name = 5
d)
Variable Name = 5
e)
Variable
45.
Which of the following is a valid identifier in Python?
a)
123name
b)
my_name
c)
$name
d)
class
e)
for
46.
Which of the following is not an advantage of using Python?
a)
It has a large and active community.
b)
It is easy to learn and read.
c)
it is a compiled language.
d)
It has a wide range of applications.
e)
It is expensive
47.

Which is the purpose of comments in Python code?

a)

To make the code run faster.

b)

To make the code more readable for humans.

c)

To remove unwanted code

d)

To prevent the code from running.

e)

Mejor prevenir que curar

48.

Which is the purpose of using keywords in Python?

a)

To create new functions.

b)

To define variables.

c)

To specify the syntax of the language.

d)

To perform mathematical operations.

e)

mathematical operations.

49.

What command will display the text 'Hello world!' on the screen?

a)

print(Hello world!)

b)

print "Hello world!"

c)

print("Hello world!")

d)

print = "Hello world!"

50.

What command will ask the user his/her age correctly?

a)

age = input("How old are you?")

b)

age = input(How old are you?)

c)

input("How old are you?") = age

d)

how_old_are_you = input()

51.

What function will convert a number to a string?

a)

int()

b)

str()

c)

chr()

d)

ord()

52.

What is the result of this command: print ("5" + "3")

a)

8

b)

"8"

c)

"5" + "3"

d)

53

53.

Which function will convert a string containing only digits to a number?

a)

int()

b)

srt()

c)

chr()

d)

ord()

54.

Which conditional statement will be executed if the variable x is less than 20?

a)

if x > 20:

b)

if x <> 20:

c)

if x == 20:

d)

if x < 20:

55.

Which of these tests checks if the variable x is the same as 'Hello'?

a)

x = "Hello"

b)

x != "Hello"

c)

x == "Hello"

d)

x <> "Hello"

56.

What is the effect of the # character?

a)

It tells Python that this is a very important line of code.

b)

It tells Python to ignore the rest of the line.

c)

It tells Python to tweet when this line of code is executed.

d)

It does nothing. Python ignores this character

57.

What is a variable (in Python)

a)

A data "storage" that you can change

b)

A data "storage" that you cannot change

c)

A coding technique

d)

A special file

58.

What does the "input()" function do?

a)

Allows users to change the program

b)

Converts data types

c)

Allows users to solve a task

d)

Allows users to enter data

59.

What data type is 3.95?

a)

Integer

b)

Float

c)

String

d)

Boolean

60.

What output should this code give if the user enters the value 70?

a)

Pass

b)

Fail

c)

Distinction

d)

Merit

61.

What is the output of this program?

a)

22

b)

50

c)

38

d)

Nothing, it will not be executed due to errors in the code.

62.

myName = input()

Is myName a string, a function, a variable, or a method?

a)

string

b)

function

c)

variable

d)

method

63.

How will we fix this code?

a)

Remove the ' ' around Bob

b)

Remove the '=' character

c)

Remove the ( ) around Name

d)

Make 'Name' lowercase

64.

What is a folder?

a)

the name given to a set of recorded information

b)

the name given to the place where files that can be bought

c)

the name given to the place where files that can be stolen

d)

the name given to the place where files that can be stored

65.

Which of the following types of computer languages uses binary code to communicate with the computer?

a)

High-level languages

b)

Assembly languages

c)

Machine language

d)

Database languages

66.
What is the process of developing and implementing various sets of instructions to enable a computer to do a certain task?
a)
Computer Engineering
b)
Computer Programming
c)
Computer Processing
d)
Computer Science
67.
What is the name of the programming language we are learning?
a)
Scratch
b)
Python
c)
Pie thin
d)
Scribble
68.
Python is an example of a....
a)
Text-based programming language
b)
Object orientated programming language
c)
language written in java script
d)
Visual-based programming language
69.
What is python?
a)
a programming language 
b)
DTP software 
c)
Spreadsheet software
d)
Computer 
70.
What is the name of the environment in Python that write your programs and then test them out?
a)
Shell
b)
Window
c)
IDLE
d)
CLI
71.

What are the names of the two types of mode that are used in Python? Select two.

a)

Interactive mode

b)

Scratch mode

c)

Imperial mode

d)

Script mode

72.

What is the name of this symbol (>>>)?

a)

Chevrons

b)

Hash tags

c)

Colon

d)

Semi Colon

73.
What is the name of the environment in Python that write your programs and then test them out?
a)
Shell
b)
Window
c)
IDLE
d)
CLI
74.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
75.
What does the term 'debug' mean?
a)
Identify errors and fix them.
b)
Making a calculation
c)
A set of instructions
d)
Looking at code
76.
What does the print function do in python?
a)
It's a variable.
b)
It can input data.
c)
It displays something like a string or integer
d)
It loops the code.
77.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
78.
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
79.

Python is _____ sensitive which means you must use the same indentation every time.

a)

space

b)

colour

c)

code

d)

word

80.
What button do you press to compile (run) your program so that it runs in the shell?
a)
F3
b)
F5
c)
F7
d)
F9
81.
What will the output be from the following code?
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
82.
What is the correct definition for a VARIABLE?
a)
a changeable value, such as a score in a computer game.
b)
a value that cannot be changed
83.

A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly.

a)

True

b)

False