Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

What will be the type of the variable x = 5.0?

View

Which of the following is an example of type casting in Python?

View

What will be the result of the following code: x = 5; print(type(str(x)))?

View

Which of the following is a valid way to convert a floating-point number to an integer in Python?

View

What is the output of this code: x = 10; y = "5"; print(x + int(y))?

View

What will be the output of this code: x = [1, 2, 3]; print(type(x))?

View

What will be the result of this code: x = 5.6; print(int(x))?

View

Which of the following is an example of a mutable data type in Python?

View

What will be the result of this code: x = (1, 2, 3); y = list(x); y.append(4); print(y)?

View

What will be the output of the following code: x = {1, 2, 3}; x.add(4); print(x)?

View

What will be the type of the variable x = 5.0?

int
float
str
complex

Which of the following is an example of type casting in Python?

x = int("5")
x = float(5)
x = str(10)
All of the above

What will be the result of the following code: x = 5; print(type(str(x)))?

<class 'int'>
<class 'str'>
<class 'float'>
<class 'bool'>

Which of the following is a valid way to convert a floating-point number to an integer in Python?

x = int(5.9)
x = float(5.9)
x = str(5.9)
None of the above

What is the output of this code: x = 10; y = "5"; print(x + int(y))?

105
15
Error
None

What will be the output of this code: x = [1, 2, 3]; print(type(x))?

<class 'list'>
<class 'tuple'>
<class 'set'>
<class 'dict'>

What will be the result of this code: x = 5.6; print(int(x))?

5.6
6
5
Error

Which of the following is an example of a mutable data type in Python?

Tuple
List
String
Integer

What will be the result of this code: x = (1, 2, 3); y = list(x); y.append(4); print(y)?

[1, 2, 3]
[1, 2, 3, 4]
(1, 2, 3, 4)
Error

What will be the output of the following code: x = {1, 2, 3}; x.add(4); print(x)?

{1, 2, 3}
{1, 2, 3, 4}
[1, 2, 3, 4]
Error