IX Practicals

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

Exercise Page

Date Topic
No No

1 Input name, age and display it.

2 Display the Multiplication Table

3 Compute the sum, product, exponent of two numbers.

4 Simple Interest Calculation

5 Simple IF Statement

6 Nested IF Statement

7 While Loop – Printing Natural Numbers

8 While Loop – Factorial of a Number


9 While Loop – Sum of Integers

10 List and For Loop

11 For Loop – Printing Numbers

12 Printing a Pattern

13 Printing the reverse of a number

14 List Creation and Manipulation

15 List – Operations

16 Determine - Armstrong number.


Exercise No: 1
Date:

Aim:
To write a Python program that ask for our name and age, and then displays it on
the screen.

Flowchart:

Program:

name = input("What is your name?...:")


age = input("How old are you?...:")
print("Welcome! Your Name is " + name)
print("You are " + age + " years old")

Output:

Result:
Thus the program is executed successfully.
Exercise No: 2
Date:

Aim:

To write a Python program that accepts a number and then prints a table for that
number.

Flowchart:
Program:

number = int (input ("Enter a number:") )


num = str(number) # convert int to string for printing in line 3
print("The Multiplication table for "+ num + " is:")
a = number*1
b = str(a)
print (num + " x 1 = " + b)
a = number*2
b = str(a)
print (num + " x 2 = " + b)
a = number*3
b = str(a)
print (num + " x 3 = " + b)
a = number*4
b = str(a)
print (num + " x 4 = " + b)
a = number*5
b = str(a)
print (num + " x 5 = " + b)
a = number*6
b = str(a)
print (num + " x 6 = " + b)
a = number*7
b = str(a)
print (num + " x 7 = " + b)
a = number*8
b = str(a)
print (num + " x 8 = " + b)
a = number*9
b = str(a)
print (num + " x 9 = " + b)
a = number*10
b = str(a)
print (num + " x 10 = " + b)
print("This program is submitted by Kiruthika G R - IX A")

Output:

Result:
Thus the program is executed successfully.

Exercise No: 3
Date:

Aim: To Write a python program to input two numbers and find


their sum, product, exponent.

Flowchart:
Program:

Output:

Result:
Thus the program is executed successfully.
Exercise No: 4
Date:

Aim: To write python code to calculate simple interest by inputting


the value of Principal amount and rate from the user for a period of
1 year.

Flowchart:

\
Program:

Output:

Result:
Thus the program is executed successfully.
Exercise No: 5
Date:

Aim: To write python code to find out whether a person is eligible


for vote or not.

Flowchart:
Program:

Output:

Result:
Thus the program is executed successfully.
Exercise No: 6
Date:

Aim: To write python code to find whether the given number is


positive or negative.

Flowchart:
Program:

Output:

Result:
Thus the program is executed successfully.
Exercise No: 7
Date:

Aim: To write python code to print all natural numbers from 1 to n


using while loop.

Flowchart:
Program:

Output:

Result:
Thus the program is executed successfully.
Exercise No: 8
Date:

Aim: To write python code to find the factorial of a number using


while loop.

Flowchart:
Program:

Output:

Result:
Thus the program is executed successfully.
Exercise No: 9
Date:

Aim: To write python code to print the sum of first 10 integers


using while loop.

Flowchart:
Program:

Output:

Result:
Thus the program is executed successfully.
Exercise No: 10
Date:

Aim: To write python code to Print each fruit in a fruit list using for
loop.

Flowchart:
Program:

Output:

Result:
Thus the program is executed successfully.
Exercise No: 11
Date:

Aim: To write python code to Print all numbers from 1 to 10 using


for, and print a message when the loop has ended.

Flowchart:
Program:

Output:

Result:
Thus the program is executed successfully.
Exercise No: 12
Date:

Aim: To write python code to print the following pattern:


1
1 1
1 11
1 111
1 1111

Flowchart:
Program:

Output:

Result:
Thus the program is executed successfully.
Exercise No: 13
Date:

Aim: To write python code to read an integer and reverse that


number.

Flowchart:
Program:

Output:

Result:
Thus the program is executed successfully.
Exercise No: 14
Date:

Aim: To create a list with the following numbers


List = [10,11,12,13,14,15,16,17,18,19,20]
And perform the following task on the list in sequence:
1. Add the second and third item on the list. Store the value as
the fourth item.
2. Delete the fourth item on the list.
3. Add 13 as the fourth item on the list.

Flowchart:

Program:

list = [10,11,12,13,14,15,16,17,18,19,20]
print ("Elements of the List")
print (list)
list[3]=list[1]+list[2]
print("Added 2nd & 3rd items and store the added result as 4th
item")
print (list)
list.pop(3)
print("List after deleting 4th item")
print (list)
list.insert(3,13)
print ("List after adding 13 as the 4th item")
print (list)
print ("Program submitted by ABC of Class IX A")
Output:

Result:
Thus the program is executed successfully.
Exercise No: 15
Date:
Aim: To Write a python program to enter three numbers into a
list (user input) and printing their sum and product.

Flowchart:

Program:

print ("Enter three numbers which is to be created as list")


list = [int(input()),int(input()),int(input())]
print (list)
a = (int(list[0]) + int(list[1]) + int(list[2]))
print ("The sum of three numbers is:" +str(a))
b = (int(list[0]) * int(list[1]) * int(list[2]))
print ("The product of three numbers is:" +str(b))
print ("Program submitted by ABC of Class IX A")

Output:

Result:
Thus the program is executed successfully.
Exercise No: 16
Date:

A number is called Armstrong number if it is equal to the sum of


the cubes of its own digits. For example: 153 is an Armstrong
number since 153 = 1*1*1 + 5*5*5 + 3*3*3. The Armstrong
number is also known as narcissistic number.

Aim:
To Write a python program to check if a given number is
an Armstrong number.

Flowchart:
Program:

Output:

Result:
Thus the program is executed successfully.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy