Question Set 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Certainly!

Here's a sample question paper based on the materials taught in both Part 1 and
Part 2 of the "Introduction to Interactive Programming in Python" course:

Section 1: Concepts and Fundamentals

1. Define and explain the following programming terms:


a) Function
b) Variable
c) Loop
d) Condition
e) Event-driven programming

2. Discuss the difference between local variables and global variables in Python. Provide
examples to illustrate your answer.

3. Explain the concept of an algorithm and its importance in programming. Describe the
steps involved in designing an algorithm.

4. Write a Python function named `factorial` that takes an integer as an argument and
returns its factorial value. Include the function definition and an example of calling the
function with an argument.

Section 2: Python Basics

5. Explain the purpose of the `if` statement in Python. Provide an example that
demonstrates the usage of the `if` statement.

6. Describe the purpose and functionality of the following Python data structures:
a) Lists
b) Tuples
c) Dictionaries

7. Write a Python program that takes a list of numbers as input and prints the sum of all the
even numbers in the list.

Section 3: Games and Interactive Applications

8. Explain the role of the `simplegui` module in building interactive applications using
CodeSkulptor. Provide an example of a CodeSkulptor program that utilizes the `simplegui`
module.

9. Implement a simple Pong game using Python and CodeSkulptor. Describe the main
components of the game and how user input is processed.

10. Describe the steps involved in creating an animated character in a game using Python
and CodeSkulptor. Include an example of code that defines and animates a character.
Section 4: Object-Oriented Programming

11. Define the concept of object-oriented programming (OOP) and its key principles. Provide
an example of a class and an object in Python.

12. Explain the purpose of inheritance in OOP. Provide an example that demonstrates
inheritance in Python.

Section 5: Advanced Topics

13. Describe the purpose and functionality of the `random` module in Python. Provide an
example that generates a random number within a specified range.

14. Implement a simplified version of the game "Blackjack" using Python and CodeSkulptor.
Describe the rules of the game and how the player's and dealer's hands are managed.

15. Explain the concept of event-driven programming and its significance in interactive
applications. Provide an example that illustrates event-driven programming in Python.

Note: This sample question paper covers a range of topics taught in both Part 1 and Part 2 of
the course. The questions are designed to assess the understanding of fundamental
programming concepts, Python basics, game development, object-oriented programming,
and some advanced topics covered in the course.

You might also like