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

Python Assignment for Class IX Students

The document outlines a Python practice assignment for Class IX, which includes tasks such as printing personal information, creating a specific pattern, calculating the square of a number, summing two numbers, and converting kilometers to meters. Each task is accompanied by example code snippets demonstrating how to implement the required functionality. The assignment aims to enhance students' understanding of basic Python programming concepts.

Uploaded by

Deepshikha Singh
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)
25 views2 pages

Python Assignment for Class IX Students

The document outlines a Python practice assignment for Class IX, which includes tasks such as printing personal information, creating a specific pattern, calculating the square of a number, summing two numbers, and converting kilometers to meters. Each task is accompanied by example code snippets demonstrating how to implement the required functionality. The assignment aims to enhance students' understanding of basic Python programming concepts.

Uploaded by

Deepshikha Singh
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 Practice Assignment

Class-IX

Write Python Codes to:

1. print personal information like Name, Father’s Name, Class,


School Name.
2. print the following pattern using single print command.
*
***
*****
*******
*********
***********
*********
*******
*****
***
*

3. find square of number 7


4. find the sum of two numbers 15 and 20.
5. convert length given in kilometers into meters. (5km)
1. Print Personal Information
print("My name is: <Your Name>")
print("My Father's Name is: <Your father’s name>")
print("I am in 9th Grade")
print("My School Name is DAV Public School, Sreshtha Vihar, Delhi")

2. Print Pattern Using Single Print Command


print("""
*
***
*****
*******
*********
*******
*****
***
* """)

3. Find Square of Number 7


number = 7
square = number * number
print("The Square of 7 is:", square)

4. Find the Sum of Two Numbers (15 and 20)


num1 = 15
num2 = 20
sum = num1 + num2
print("Sum of 15 and 20 is:", sum)

5. Convert Kilometers to Meters


km = 5
m = km * 1000
print(km, "kilometers is", m, "meters")

You might also like