0% found this document useful (0 votes)
3 views3 pages

Bny Sec Ahw 2509031920 172424 1

The document is a worksheet for Class 9 on Python programming basics, containing questions and answers across four parts: very short, short, long, and higher-order thinking questions. It covers fundamental concepts such as identifiers, data types, operators, and the importance of Python in various applications. The worksheet aims to assess students' understanding of Python programming principles and practices.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Bny Sec Ahw 2509031920 172424 1

The document is a worksheet for Class 9 on Python programming basics, containing questions and answers across four parts: very short, short, long, and higher-order thinking questions. It covers fundamental concepts such as identifiers, data types, operators, and the importance of Python in various applications. The worksheet aims to assess students' understanding of Python programming principles and practices.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Class 9 – Python Programming Basics Worksheet

(With Answers)

Part A – Very Short Answer Questions (1 Mark Each)

1. What is Python?
→ Python is a high-level, interpreted, and general-purpose programming language.

2. Who developed Python and in which year?


→ Python was developed by Guido van Rossum in 1991.

3. Define an identifier in Python.


→ An identifier is the name used to identify variables, functions, classes, or objects.

4. Give one example each of a keyword and an identifier.


→ Keyword: while
→ Identifier: marks

5. What is the difference between = and ==?


→ = is the assignment operator (used to store value).
→ == is the comparison operator (used to check equality).

6. Write any two features of Python.


→ (i) Easy to learn and use
→ (ii) Open-source and portable

7. What do you mean by indentation in Python?


→ Indentation refers to spaces given at the beginning of a statement to define blocks of code.

8. What is the default data type of numbers with a decimal point in Python?
→ float

9. Name any four Python data types.


→ int, float, str, list

10. Define a variable in Python.


→ A variable is a named location in memory used to store data.

------------------------------------------------------------

Part B – Short Answer Questions (2 Marks Each)

1. Differentiate between keywords and identifiers with an example.


→ Keywords are reserved words with special meaning (e.g., for, if).
→ Identifiers are user-defined names for variables/functions (e.g., age, total).
2. What is type casting in Python? Give one example.
→ Type casting is converting one data type into another. Example: int(3.5) → 3

3. Explain mutable and immutable data types with examples.


→ Mutable data can be changed (e.g., list).
→ Immutable data cannot be changed (e.g., tuple, string).

4. What are constants in Python? Give two examples.


→ Constants are fixed values that do not change during program execution. Example: PI = 3.14,
GRAVITY = 9.8.

5. Explain the difference between float and integer data types.


→ Integer: Whole numbers without decimals (e.g., 10).
→ Float: Numbers with decimals (e.g., 10.5).

6. List any four applications of Python.


→ Web development, Data science, Artificial intelligence, Game development

7. What is a string in Python? How is it written?


→ A string is a sequence of characters enclosed in single or double quotes. Example: "Hello",
'Python'

8. Differentiate between syntax error and logical error.


→ Syntax error: Occurs due to incorrect code format.
→ Logical error: Occurs when code runs but produces wrong output.

------------------------------------------------------------

Part C – Long Answer Questions (3–4 Marks Each)

1. Explain the importance of Python in today’s world.


→ Python is widely used in data science, AI, machine learning, web apps, automation, and
education. Its simplicity and flexibility make it one of the most popular languages today.

2. Describe any five characteristics of Python programming language.


- Easy to learn and use
- Portable and platform-independent
- Open-source and free
- Supports Object-Oriented Programming
- Large standard library

3. Explain the concept of operators in Python with examples:


- Arithmetic operators: +, -, *, /
- Relational operators: ==, >, <
- Logical operators: and, or, not

4. What is the difference between input() and print() functions?


- input() is used to take input from the user.
- print() is used to display output on the screen.

5. Explain the difference between mutable and immutable data types with suitable examples.
- Mutable: List → [1,2,3] (values can be changed).
- Immutable: String → "Hello" (values cannot be changed).

6. Describe the rules for naming identifiers in Python.


- Must start with a letter or underscore
- Cannot use keywords
- Case-sensitive
- Can contain letters, digits, and underscores

7. Explain the use of comments in Python. Differentiate between single-line and multi-line
comments.
- Comments are notes in code ignored by the interpreter.
- Single-line: # This is a comment
- Multi-line: ''' This is a multi-line comment '''

------------------------------------------------------------

Part D – Higher Order Thinking Question (5 Marks)

1. “Python is called a high-level, interpreted, and object-oriented language.” Justify this.


- High-level: Easy to read and understand like English.
- Interpreted: Code is executed line by line by the Python interpreter.
- Object-Oriented: Supports concepts like classes, objects, inheritance, and polymorphism.

You might also like