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

Python Programming Answer Sheet Guide

The document outlines a Python programming curriculum divided into four units covering introduction to Python, data types, functions and modules, and object-oriented programming with libraries. It includes example code for basic operations like summing two numbers, checking if a number is positive or negative, and demonstrating a class and object. The content is designed to provide foundational knowledge and practical examples for learners.

Uploaded by

rasnesiddesh
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 views2 pages

Python Programming Answer Sheet Guide

The document outlines a Python programming curriculum divided into four units covering introduction to Python, data types, functions and modules, and object-oriented programming with libraries. It includes example code for basic operations like summing two numbers, checking if a number is positive or negative, and demonstrating a class and object. The content is designed to provide foundational knowledge and practical examples for learners.

Uploaded by

rasnesiddesh
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

PYTHON PROGRAMMING — ANSWER SHEET

UNIT 1 — INTRODUCTION TO PYTHON


History, features, data types, operators, type conversion, variables, keywords, and basic programs.

UNIT 2 — PYTHON DATA TYPES & STRING/LIST/TUPLE/DICT


Strings, lists, tuples, dictionaries, slicing, methods, and examples.

UNIT 3 — FUNCTIONS AND MODULES


Function types, arguments, return statement, lambda, modules, scope, and examples.

UNIT 4 — OOP & PYTHON LIBRARIES


Classes, objects, constructor, inheritance, polymorphism, libraries: NumPy, Pandas, Matplotlib.

Example Answer — Sum of Two Numbers


a = float(input('Enter first number: '))
b = float(input('Enter second number: '))
print('Sum =', a + b)

Example Answer — Check Positive or Negative


n = float(input('Enter number: '))
if n > 0:
print('Positive')
elif n == 0:
print('Zero')
else:
print('Negative')
Example — Class and Object (OOP)
class Student:
def __init__(self, name, age):
[Link] = name
[Link] = age

def display(self):
print('Name:', [Link], 'Age:', [Link])

s = Student('Asha', 20)
[Link]()

You might also like