Font size
Worksheetspytohn
Total questions: 83
Worksheet time: 45mins
¿Cuál de las siguientes opciones es correcta?
¿Qué se muestra por pantalla?
edad
(edad)
Tu edad es: 20
20
¿Cuál de las siguientes opciones es una variable de tipo Float?
-7.12
5
'8.2'
10.4
¿Qué es Python?
Una serpiente
Un lenguaje de programación
Un programa de Software
Un cuento
Python es
Una serpiente
Un lenguaje de programación
¿Qué pasa cuando escribes el texto verde?
print ('Hola Mundo')
Nada
Le mandas un mensaje sms a todo el mundo
Muestra en pantalla Hola Mundo
Muestras en pantalla 'Hola Mundo'
What is the output of this code
8
13
It gives an error
6
What line of code will generate an error?
1
2
3
4
What will be the output of this code?
5
6
7
8
What will be the result of this code?
1
2
3
4
Which of these examples show the correct way to write a list?
fruit = apple, banana, pear, cherry
fruit=['apple','banana','pear','cherry']
fruit = ('apple', 'banana', 'pear', 'cherry')
fruit=['apple'+'banana'+'pear'+'cherry']
What type of variables does this list contain?
OneD = ['Niall','Zayn','Liam','Harry','Louis']
Integer
Float
String
Boolean
Which of the following commands will print all the items of this list:
fruits = ["apple", "banana", "pear", "strawberry"]
print(fruit)
print(fruits)
print("fruits")
print[fruits]
One list may contain data from different types:
MyList = ["Yellow", 2, 3, "Blue"]
True
False
It is possible to do many things with a list in Python. Which of the following CANNOT be done?
Add an item
Concatenate two lists
Remove an item
Decide which items are the most importants
What is the smallest number of elements that a list can contain?
0
1
2
-1
Which of these keywords is fake?
False
None
Finally
Repeat
Continue
()
Símbolo más
/
Símbolo igual
{}
Which of the following is a invalid Identifier?
score
pedro22
highest_score
@core
return_value
A literal in Python is:
Variable that do not change in value during the execution of the program.
Data type that represent a single value.
Function integrated into the language.
Keyword that have a special meaning in Python.
None of them
Which of this words is a keyword?
imput
caracol
RAM
and
5+5
Which is the purpose of comments in Python code?
To make the code run faster.
To make the code more readable for humans.
To remove unwanted code
To prevent the code from running.
Mejor prevenir que curar
Which is the purpose of using keywords in Python?
To create new functions.
To define variables.
To specify the syntax of the language.
To perform mathematical operations.
mathematical operations.
What command will display the text 'Hello world!' on the screen?
print(Hello world!)
print "Hello world!"
print("Hello world!")
print = "Hello world!"
What command will ask the user his/her age correctly?
age = input("How old are you?")
age = input(How old are you?)
input("How old are you?") = age
how_old_are_you = input()
What function will convert a number to a string?
int()
str()
chr()
ord()
What is the result of this command: print ("5" + "3")
8
"8"
"5" + "3"
53
Which function will convert a string containing only digits to a number?
int()
srt()
chr()
ord()
Which conditional statement will be executed if the variable x is less than 20?
if x > 20:
if x <> 20:
if x == 20:
if x < 20:
Which of these tests checks if the variable x is the same as 'Hello'?
x = "Hello"
x != "Hello"
x == "Hello"
x <> "Hello"
What is the effect of the # character?
It tells Python that this is a very important line of code.
It tells Python to ignore the rest of the line.
It tells Python to tweet when this line of code is executed.
It does nothing. Python ignores this character
What is a variable (in Python)
A data "storage" that you can change
A data "storage" that you cannot change
A coding technique
A special file
What does the "input()" function do?
Allows users to change the program
Converts data types
Allows users to solve a task
Allows users to enter data
What data type is 3.95?
Integer
Float
String
Boolean
What output should this code give if the user enters the value 70?
Pass
Fail
Distinction
Merit
What is the output of this program?
22
50
38
Nothing, it will not be executed due to errors in the code.
myName = input()
Is myName a string, a function, a variable, or a method?
string
function
variable
method
How will we fix this code?
Remove the ' ' around Bob
Remove the '=' character
Remove the ( ) around Name
Make 'Name' lowercase
What is a folder?
the name given to a set of recorded information
the name given to the place where files that can be bought
the name given to the place where files that can be stolen
the name given to the place where files that can be stored
Which of the following types of computer languages uses binary code to communicate with the computer?
High-level languages
Assembly languages
Machine language
Database languages
What are the names of the two types of mode that are used in Python? Select two.
Interactive mode
Scratch mode
Imperial mode
Script mode
What is the name of this symbol (>>>)?
Chevrons
Hash tags
Colon
Semi Colon
Python is _____ sensitive which means you must use the same indentation every time.
space
colour
code
word
print(3*4+5)
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly.
True
False
