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 result of the following code: x = 5; y = x + 10; print(y)?
Which of the following is a correct way to declare multiple variables in one line in Python?
Which of the following is true about Python variable scope?
What will be the output of this code: x = 10; def my_func(): x = 5; print(x); my_func(); print(x)?
Which keyword is used to modify a global variable inside a function?
What will be the output of this code: x = 7; def change(): global x; x = 10; change(); print(x)?
In Python, which of the following data types can be used as variable names?
What will happen if you assign a variable name that already exists in the global scope inside a function?
What is the result of this code: x, y = 5, 10; x, y = y, x; print(x, y)?
What will be the output of this code: def func(a, b = 5): return a + b; print(func(10))?