Python
Python
1. Define the following (do any 10) . Define the following (do any 10)
A. What is Python? A. What is Python?
B. What is identifier? B. What is identifier?
C. What is Comments? C. What is Comments?
D. What is Variable? D. What is Variable?
E. What is Operator? E. What is Operator?
F. What is String? F. What is String?
G. What is Number? G. What is Number?
H. What is Function? H. What is Function?
I. What is Conditional Statement? I. What is Conditional Statement?
J. What is Looping Statement? J. What is Looping Statement?
PART-B Marks 4*5=20 PART-B Marks 4*5=20
4. Explain the purpose of comments in Python code and how they are written. 4. Explain the purpose of comments in Python code and how they are written.
or or
What are Python identifiers, and what are the rules for naming them? What are Python identifiers, and what are the rules for naming them?
5. Describe the basic style guidelines recommended for writing Python code. 5. Describe the basic style guidelines recommended for writing Python code.
or or
What is the difference between standard types and internal types in Python? Provide examples. What is the difference between standard types and internal types in Python? Provide examples.
6. How does Python handle memory management, and what are some techniques used to manage 6. How does Python handle memory management, and what are some techniques used to manage
memory efficiently in Python programs? memory efficiently in Python programs?
or or
Write a Python program using an if statement to check if a number is positive, negative, or zero. Write a Python program using an if statement to check if a number is positive, negative, or zero.
Include an example with a while loop that prints numbers from 1 to 5. Include an example with a while loop that prints numbers from 1 to 5.
7. What are the four main principles of object-oriented programming (OOP) in Python? 7. What are the four main principles of object-oriented programming (OOP) in Python?
or or
How do you define a class in Python, and what is the purpose of the init method? How do you define a class in Python, and what is the purpose of the init method?