Font size
WorksheetsRecuperacion final parte 1
Total questions: 20
Worksheet time: 38mins
What is Python?
A programming language
A program to make programs
A type of game
A design language
In Python, the function (a) allows you to display text or the content of a variable on the screen
What is displayed on the screen?
age
(age)
Your age is: 20
20
What are variables?
A type of data that remains the same within a program
The same as a program
Data of a function
An identifier for storing data
In Python, there are different types of resources that we can use, such as variables, lists, functions, tuples, dictionaries, and at the same time, these elements can contain data. What types of data can be stored in these resources?
texts, numbers, booleans
Integers, decimals, complexes
true, false
addition, subtraction, multiplication, and division
Operators are actions, commands, or symbols that we as programmers know and use for some task we have in mind, the operator ( = ) translates to or means ...
to give or assign a value
equal to
result of some operation
greater than or equal to
What is the correct syntax to write a variable that contains text
variable = "Text"
variable = text
my variable = ("text")
variable = text
Write in a single line of code a function that prints "Hello world"
(a)
In what position of the array is the element "conejo"
mi_lista[2]
mi_lista[1]
mi_lista[3]
mi_lista[4]
"False" is a variable of type
Boolean
String
Integer
Float
Loops in Python.
Analyze and complete the code.
Numbers from 1 to 10 should be printed.
Do not leave unnecessary spaces in your answer.
(a)
Define a function water that takes a single temperature parameter (in degrees Celsius), and prints whether the water is a solid, liquid, or gas.
Remember the states of the water
Is solid if the temperature is below or equal to 0°,
is liquid if the teperature is between 1° and 100°
is gas if the temperature is over 100°
Given a list of what a group of people ordered and the price of each item as a dictionary, print the group's total bill.
ordered = ["steak", "fish", "salad"]
price ={ "steak": 15, "fish": 12, "chicken": 8, "salad": 7 }
What is the value in Z?
x = 10
y = 15
y = x + y
z = y + x
(a)
Using the variables a and b print 26
a=10
b="16"
(a)
Given the distance (In km) to a destination and the speedLimit in (km/h). print how long it would take to reach the destination IN MINUTES
distance = 120
speedLimit = 100
What is a list in Python?
A type of variable
A collection of items
A function that returns multiple values
A fixed-size array
What does the 'len()' function do in Python?
Checks if an object is empty
Converts a string to a list
Calculates the sum of a list
Returns the length of an object
What does the 'append()' method do in Python lists?
Adds an item to the end of the list
Append an item to the function
Removes an item
Includes a new item to the code that can be used as reference further in the code
What is the output of the expression '5' + 3 in Python?
2
TypeError
53
8
