answers 100% correct 2025
print the type (or class) of the entire variable x print - correct answer (f'x is a
variable of type (or class): {type(x)}.')
print the type (or class) of the first element within the variable x - correct
answer print(f'Within x, the individual scores are of type (or class):
{type(x[0])}.')
Sort the variables of x - correct answer x.sort()
rint your newly sorted x variable - correct answer print(f'Now x is sorted. x =
{x}')
Print the sum of x - correct answer print(f'The sum of x is: {sum_x}.')
How many integers are in x? Print this number - correct answer print(f'x has
{len(x)} data points in it.')
Add your integer to itself - correct answer print(my_int + my_int)
Multiply your name by 4 - correct answer print(my_name * 4)
Can you add your integer to your name - correct answer rint(my_name +
str(my_int))
In most programming languages, including Python, you cannot directly
concatenate a string with an integer. You can only concatenate strings with
, other strings. That's why you need to convert my_int to a string using the str()
function before you can concatenate it with my_name.
Use the = operator to define a new floating point variable - correct answer
my_float = 8.5
print(f'This variable has a decimal place: {my_float}')
print(f'It is type: {type(my_float)}')
This value is a floating-point number because it has a decimal point.
Divide the integer by the number 1 and print both the result and the data type
of the result - correct answer print(my_int / 1)
print(f'It is type: {type(my_int / 1)}')
Square a number using the square operator - correct answer print(f'3 squared
is: {3 ** 2}')
Cube the same number by adapting the square operator - correct answer
print(f'3 cubed is: {3 ** 3}')
Floor division: the floor division operator is '//'. What does it do? - correct
answer The floor division operator // in Python performs integer division, also
known as floor division. It divides one number by another and returns the
largest whole number (integer) that is less than or equal to the result.
e.g print(f'This quotient (13 // 5) is not what you would expect: {13 // 5}') = 2
Finally, the modulo operator is '%'. - correct answer Its job is to return the
remainder in a division problem