0% found this document useful (0 votes)
6 views32 pages

Python Projects For Kids@Preshnave Muthukutty

The document outlines a series of basic Python projects designed for students, including tasks such as printing statements, performing arithmetic operations, type casting, and creating patterns. Each project includes configuration details, source code, and expected output, making it a practical guide for beginners. The projects aim to teach fundamental programming concepts in Python through hands-on examples.

Uploaded by

testservicecare
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)
6 views32 pages

Python Projects For Kids@Preshnave Muthukutty

The document outlines a series of basic Python projects designed for students, including tasks such as printing statements, performing arithmetic operations, type casting, and creating patterns. Each project includes configuration details, source code, and expected output, making it a practical guide for beginners. The projects aim to teach fundamental programming concepts in Python through hands-on examples.

Uploaded by

testservicecare
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/ 32

PYTHON PROJECTS

for
STUDENTS

Prepared By

M. PRESHNAVE MUTHUKUTTY

UGC NET | CTET | TRB | TNEB | GATE | ESE | UPSC | NEET | TET | SET | SSC | CAT | MAT | TNPSC

Test Shopping Innovative E-Learning


E.Mail: [email protected] | [email protected] | [email protected] | Ph:
9345779192 www.testshopping.in

Python Basic Projects for Kids | Preshnave Muthukutty


Print and commend using Python

Configuration Details:

1. Problem Print a statement and commend practice


2. Solver Python
3. Compiler Visual Studio Code Compiler

Source Code Details:

#Print a Sting statement

print("College of Engineering, Anna University")

Source Code Output Details:

College of Engineering, Anna University

Python Basic Projects for Kids | Preshnave Muthukutty


Add variable to another variable using Python

Configuration Details:

1. Problem Add many variables using Python


2. Solver Python
3. Compiler Visual Studio Code Compiler

Source Code Details:

variable1=("Division of High Voltage Engineering | ")

variable2=("College of Engineering | ")

variable3=("Anna University | ")

variable4=("Chennai")

print(variable1+variable2+variable3+variable4)

Source Code Output Details:

Division of High Voltage Engineering | College of Engineering | Anna University | Chennai

Python Basic Projects for Kids | Preshnave Muthukutty


Arithmetic Operation in Python

Configuration Details:

Arithmetic Operation (addition, subtraction, multiplication and


1. Problem
division
2. Solver Python
3. Compiler Visual Studio Code Compiler
Addition (" + "), Subtraction (" − "), Division (" + "),
4. Analytical Operation
Multiplication(" + "), Modulus (" + "),

Source Code Details:

#Enter Integer Inputs


first_number=int(input("Enter the value of a:"))
second_number=int(input("Enter the value of b:"))

#Addition of two numbers


Addition=first_number+second_number
print("Addition of two inputs is:", Addition)

#Multiplication two numbers


Multiplication=first_number*second_number
print("Multiplication of two inputs is:", Multiplication)

#Division two numbers


Division=first_number/second_number
print("Division of two inputs is:", Division)

#Subtraction two numbers


Subtraction=first_number-second_number
print("Subtraction of two inputs is:", Subtraction)

#Modulus two numbers


Modulus=first_number%second_number
print("Modulus of two inputs is:", Modulus)

Python Basic Projects for Kids | Preshnave Muthukutty


Source Code Output Details:

Enter the value of a:20

Enter the value of b:15

Addition of two inputs is: 35

Multiplication of two inputs is: 300

Division of two inputs is: 1.3333333333333333

Subtraction of two inputs is: 5

Modulus of two inputs is: 5

Python Basic Projects for Kids | Preshnave Muthukutty


Type Casting in Python

Configuration Details:

1. Problem Type casting


2. Solver Python
3. Compiler Visual Studio Code Compiler
4. Analytical Operation Conversion from “Integer to Float” and “Float to Integer”.

Source Code Details:

#Enter First Inputs


First_number=int(input("Enter the value of a:"))
print(First_number)
print(type(First_number))

#Enter Second Inputs


Second_number=float(input("Enter the value of b:"))
print(Second_number)
print(type(Second_number))

#Casting First Inputs into Float


print("Python casting First Number is:")
Third_number=float(First_number)
print(Third_number)

#Casting Second Inputs into Integer


print("Python casting Second Number is:")
Fourth_number=int(Second_number)
print(Fourth_number)

Source Code Output Details:

Enter the value of a:20

20

Python Basic Projects for Kids | Preshnave Muthukutty


<class 'int'>

Enter the value of b:23.5

23.5

<class 'float'>

Python casting First Number is:

20.0

Python casting Second Number is:

23

Python Basic Projects for Kids | Preshnave Muthukutty


Convert input into upper case in Python

Configuration Details:

1. Problem Convert my given input into upper case letters


2. Solver Python
3. Compiler Visual Studio Code Compiler

Source Code Details:

a=input("Enter the input content:")


print(a)
print(a.upper())

Source Code Output Details:

Enter the input content:

Transport is a fundamental requirement of modern life, but the traditional combustion engine is
quickly becoming outdated. Petrol or diesel vehicles are highly polluting and are being quickly
replaced by fully electric vehicles. The running cost of an electric vehicle is much lower than an
equivalent petrol or diesel vehicle. Electric vehicles use electricity to charge their batteries instead
of using fossil fuels like petrol or diesel. Electric vehicles are more efficient, and that combined
with the electricity cost means that charging an electric vehicle is cheaper than filling petrol or
diesel for your travel requirements. Using renewable energy sources can make the use of electric
vehicles more eco-friendly. The electricity cost can be reduced further if charging is done with the
help of renewable energy sources installed at home, such as solar panels. Electric vehicles have
very low maintenance costs because they don’t have as many moving parts as an internal
combustion vehicle.

TRANSPORT IS A FUNDAMENTAL REQUIREMENT OF MODERN LIFE, BUT THE


TRADITIONAL COMBUSTION ENGINE IS QUICKLY BECOMING OUTDATED. PETROL
OR DIESEL VEHICLES ARE HIGHLY POLLUTING AND ARE BEING QUICKLY
REPLACED BY FULLY ELECTRIC VEHICLES. THE RUNNING COST OF AN ELECTRIC
VEHICLE IS MUCH LOWER THAN AN EQUIVALENT PETROL OR DIESEL VEHICLE.
ELECTRIC VEHICLES USE ELECTRICITY TO CHARGE THEIR BATTERIES INSTEAD OF

Python Basic Projects for Kids | Preshnave Muthukutty


USING FOSSIL FUELS LIKE PETROL OR DIESEL. ELECTRIC VEHICLES ARE MORE
EFFICIENT, AND THAT COMBINED WITH THE ELECTRICITY COST MEANS THAT
CHARGING AN ELECTRIC VEHICLE IS CHEAPER THAN FILLING PETROL OR DIESEL
FOR YOUR TRAVEL REQUIREMENTS. USING RENEWABLE ENERGY SOURCES CAN
MAKE THE USE OF ELECTRIC VEHICLES MORE ECO-FRIENDLY. THE ELECTRICITY
COST CAN BE REDUCED FURTHER IF CHARGING IS DONE WITH THE HELP OF
RENEWABLE ENERGY SOURCES INSTALLED AT HOME, SUCH AS SOLAR PANELS.
ELECTRIC VEHICLES HAVE VERY LOW MAINTENANCE COSTS BECAUSE THEY
DON’T HAVE AS MANY MOVING PARTS AS AN INTERNAL COMBUSTION VEHICLE.

Python Basic Projects for Kids | Preshnave Muthukutty


Print pyramid pattern using Python

Configuration Details:

1. Problem Print Pyramid Pattern by using star symbol


2. Solver Python
3. Compiler Visual Studio Code Compiler

Source Code Details:

n = int(input("Enter the number of rows:"))

for i in range(0, n):

for j in range(0, i + 1):

print("* ", end="")


print()

Source Code Output Details:

Enter the number of rows:5

**

***

****

*****

Python Basic Projects for Kids | Preshnave Muthukutty


Number pattern using Python

Configuration Details:

1. Problem Number Pattern by using numbers


2. Solver Python
3. Compiler Visual Studio Code Compiler

Source Code Details:

n = int(input("Enter the number of rows:"))

for i in range(1, n + 1):

for j in range(1, i + 1):

print(j, end='')
print()

Source Code Output Details:

Enter the number of rows:8

12

123

1234

12345

123456

1234567

12345678

Python Basic Projects for Kids | Preshnave Muthukutty


If ….If else condition in Python

Configuration Details:

1. Problem If ….If else condition


2. Solver Python
3. Compiler Visual Studio Code Compiler
4. Analytical Operation Determine the greater numbers between two integers.

Source Code Details:

#Enter Inputs
First_number=int(input("Enter the value of a:"))
Second_number=int(input("Enter the value of b:"))
if First_number>Second_number:
print("Greater Number is:", First_number)
print("First_number is greater than Second_number")
print("Condition is True")
else:
print("Greater Number is:", Second_number)
print("Condition is False")

Source Code Output Details:

Condition I:

Enter the value of a:25

Enter the value of b:20

Greater Number is: 25

First_number is greater than Second_number

Condition is True

Python Basic Projects for Kids | Preshnave Muthukutty


Condition II:

Enter the value of a:10

Enter the value of b:25

Greater Number is: 25

Condition is False

Python Basic Projects for Kids | Preshnave Muthukutty


Count of character in string using Python

Configuration Details:

1. Problem Count Function


2. Solver Python
3. Compiler Visual Studio Code Compiler
4. Analytical Operation Count “g” and “e” character in a string using Python

Source Code Details:

#Input Inititalization
Name=str(input("Enter the character:"))
#Count Operation
counter=Name.count('g')
print("Count of 'g' in given input is:"+str(counter))
counter=Name.count('e')
print("Count of 'e' in given input is:"+str(counter))

Source Code Output Details:

Enter the character:

Transport is a fundamental requirement of modern life, but the traditional combustion engine is
quickly becoming outdated. Petrol or diesel vehicles are highly polluting and are being quickly
replaced by fully electric vehicles. The running cost of an electric vehicle is much lower than an
equivalent petrol or diesel vehicle. Electric vehicles use electricity to charge their batteries instead
of using fossil fuels like petrol or diesel. Electric vehicles are more efficient, and that combined
with the electricity cost means that charging an electric vehicle is cheaper than filling petrol or
diesel for your travel requirements. Using renewable energy sources can make the use of electric
vehicles more eco-friendly. The electricity cost can be reduced further if charging is done with the
help of renewable energy sources installed at home, such as solar panels. Electric vehicles have
very low maintenance costs because they don’t have as many moving parts as an internal
combustion vehicle.

Count of 'g' in given input is:17

Count of 'e' in given input is:128

Python Basic Projects for Kids | Preshnave Muthukutty


Largest and Smallest Number Search using Python

Configuration Details:

1. Problem Find maximum and minimum numbers in a given input


2. Solver Python
3. Compiler Visual Studio Code Compiler

Source Code Details:

Largest Number Search:

#Getting Input
First_Number=int(input("Enter the value of First Number:"))
Second_Number=int(input("Enter the value of Second Number:"))
Third_Number=float(input("Enter the value of Third Number:"))
#maximum Search
maximum=max(First_Number,Second_Number,Third_Number)
print("The largest number in a given input is:", maximum)

Smallest Number Search:

#Getting Input
First_Number=int(input("Enter the value of First Number:"))
Second_Number=int(input("Enter the value of Second Number:"))
Third_Number=float(input("Enter the value of Third Number:"))
#maximum Search
minimum=min(First_Number,Second_Number,Third_Number)
print("The smallest number in a given input is:", minimum)

Source Code Output Details:

Largest Number Search:

Enter the value of First Number:50

Enter the value of Second Number:100

Enter the value of Third Number:20.3

Python Basic Projects for Kids | Preshnave Muthukutty


The largest number in a given input is: 100

Smallest Number Search:

Enter the value of First Number:10

Enter the value of Second Number:50

Enter the value of Third Number:22.1

The smallest number in a given input is: 10

Python Basic Projects for Kids | Preshnave Muthukutty


Reverse a number using Python

Configuration Details:

1. Problem Reverse a number using Python. Example: 123456789 → 987654321


2. Solver Python
3. Compiler Visual Studio Code Compiler
Initial reverse number = 0 | 𝑊ℎ𝑖𝑙𝑒(𝑁𝑢𝑚𝑏𝑒𝑟 > 0)| Multiply
4. Analytic Solution reverse number by 10 and Add reminder of number divided by 10 to
reverse number | Divided number by 10 | Return reverse number.

Source Code Details:

number=int(input("Enter the numbers:"))


reverse_number=0
while(number > 0):
remainder = number % 10
reverse_number = (reverse_number * 10) + remainder
number = number // 10
print("The reverse number is :", reverse_number)

Source Code Output Details:

Enter the numbers:123456789

The reverse number is: 987654321

Python Basic Projects for Kids | Preshnave Muthukutty


Students Marks and Grade calculation using Python

Configuration Details:

1. Problem Students Marks and Grade calculation


2. Solver Python
3. Compiler Visual Studio Code Compiler

Source Code Details:

#Enter Student Details


student_name=input("Enter Student Name:")
student_Rollno=int(input("Enter Student Roll No:"))
student_Class=input("Enter Student Class:")

#Enter Student Marks Details


Mark_Python=int(input("Enter Python Mark:"))
Mark_Java=int(input("Enter Java Mark:"))
Mark_Data_Science=int(input("Enter Data Science Mark:"))
Mark_HTML=int(input("Enter HTML Mark:"))
Mark_CSS=int(input("Enter CSS Mark:"))

#Add Student Marks


total=(Mark_Python+Mark_Java+Mark_Data_Science+Mark_HTML+Mark_CSS)
print(total)

#Find Average
average=(total/500)*100
print(average)

#Find Grades
marks=100
if marks >=90:
print("A+ Grade")
print("Very Good")
elif marks >=80:
print("A Grade")

Python Basic Projects for Kids | Preshnave Muthukutty


print("Good")
elif marks >=70:
print("B+ Grade")
print("Average")
elif marks >=60:
print("B Grade")
print("Below Average")
else:
print("U Grade")
print("RA")

Source Code Output Details:

Enter Student Name: John

Enter Student Roll No:2020218036

Enter Student Class: BE

Enter Python Mark:98

Enter Java Mark:99

Enter Data Science Mark:99

Enter HTML Mark:97

Enter CSS Mark:98

491

98.2

A+ Grade

Very Good

Python Basic Projects for Kids | Preshnave Muthukutty


File Handling using Python

Configuration Details:

1. Problem Open, write and read a text file using Python


2. Solver Python
3. Compiler Visual Studio Code Compiler

Source Code Details without listing method:

a=open("mydata.txt", "w")

a.write("College of Engineering\n")

a.write("Anna University\n")

a.write("Tamil Nadu\n")

a.write("Chennai")

a.close()

Source Code Output Details without listing method:

College of Engineering

Anna University

Tamil Nadu

Chennai

Source Code Details with listing method:

a=open("mydata.txt", "w")

my_content=["College of Engineering\n", "Anna University\n", "Tamil Nadu\n", "Chennai"]

a.writelines(my_content)

Python Basic Projects for Kids | Preshnave Muthukutty


a.close()

Source Code Output Details with listing method:

College of Engineering

Anna University

Tamil Nadu

Chennai

Source Code Details with for loop method:

a=open("mydata.txt", "w")

my_content=["Division of High Voltage Engineering", "College of Engineering", "Anna


University", "Tamil Nadu", "Chennai"]

for details in my_content:

a.write(details+ "\n")

a.close()

Source Code Output Details with for loop method:

Division of High Voltage Engineering

College of Engineering

Anna University

Tamil Nadu

Chennai

Source Code Details for read operation:

a=open("mydata.txt","r")

Python Basic Projects for Kids | Preshnave Muthukutty


print(a.read())

Source Code Output Details for read operation:

Division of High Voltage Engineering

College of Engineering

Anna University

Tamil Nadu

Chennai

Source Code Details: (Read code from text file)

a=open("mydata.txt","r")

mydata=a.readlines()

a.close()

for details in range(5):

print(mydata[details])

Source Code Output Details: (Read code from text file)

Division of High Voltage Engineering

College of Engineering

Anna University

Tamil Nadu

Chennai

Python Basic Projects for Kids | Preshnave Muthukutty


Source Code Details: (Read and repeat last line)

a=open("mydata.txt","r")

mydata=a.readlines()

a.close()

for details in range(5):

print(mydata[details])

print(mydata[-1])

Source Code Output Details: (Read and repeat last line)

Division of High Voltage Engineering

College of Engineering

Anna University

Tamil Nadu

Chennai

Chennai

Python Basic Projects for Kids | Preshnave Muthukutty


Create Update and Delete process in MySQL using Python

Configuration Details:

1. Problem Create, Update and delete database


2. Solver Python
3. Compiler Visual Studio Code Compiler | Xampp Control Panel

Source Code Details:

import mysql.connector

con=mysql.connector.connect(host="localhost",user="root",password="",database="project1"
)

def insert(name, age, city):


res=con.cursor()
sql="insert into users (name,age, city) values(%s,%s,%s)"
user=(name, age, city)
res.execute(sql, user)
con.commit()
print("Data Insert Success")

def update(name, age, city, id):


res=con.cursor()
sql="update users set name=%s, age=%s, city=%s where id=%s"
user=(name, age, city, id)
res.execute(sql, user)
con.commit()
print("Data update Success")

def select():
res=con.cursor()
sql="SELECT ID, NAME, AGE, CITY from users"
res.execute(sql)
result=res.fetchall()
print(result)

Python Basic Projects for Kids | Preshnave Muthukutty


def delete(id):
res=con.cursor()
sql="delete from users where id=%s"
user=(id,)
res.execute(sql, user)
con.commit()
print("Data Delete success")

while True:
print("1. Insert Data")
print("2. Update Data")
print("3. Select Data")
print("4. Delete Data")
print("5. Exit")
choice=int(input("Enter Your Choice:"))

if choice==1:
name=input("Enter name:")
age=input("Enter age:")
city=input("Enter city:")
insert(name, age, city)
elif choice==2:
id=input("Enter the id:")
name=input("Enter name:")
age=input("Enter age:")
city=input("Enter city:")
update(name, age, city, id)
elif choice==3:
select()
elif choice==4:
id=input("Enter the id to delecte:")
delete(id)
elif choice==5:
quit()
else:
print("Invalid Selection...Please Try Again!")

Python Basic Projects for Kids | Preshnave Muthukutty


Source Code Output Details:

1. Insert Data

2. Update Data

3. Select Data

4. Delete Data

5. Exit

Enter Your Choice:1

Enter name: Asuty

Enter age:24

Enter city: Nagercoil

Data Insert Success

Python Basic Projects for Kids | Preshnave Muthukutty


1. Insert Data

2. Update Data

3. Select Data

4. Delete Data

5. Exit

Enter Your Choice:2

Enter the id:3

Enter name: Dinesh Kumar

Enter age:24

Enter city: KNR Chennai

Data update Success

Python Basic Projects for Kids | Preshnave Muthukutty


Python Basic Projects for Kids | Preshnave Muthukutty
Create Data Set using Pandas in Python

Configuration Details:

1. Problem Create student name list and student mark list using Pandas
2. Solver Python
3. Compiler Visual Studio Code Compiler

Source Code Details:

import pandas as pd

dataset = {
'Students_names' : ["Suruthi", "Monish Kumar", "Dinesh Kumar", "Hari Ram", "Tharini",
"Antli Sumin"],
'Students_marks' : [92, 85, 93, 88, 96, 98]
}

class_result = pd.DataFrame(dataset)
print(class_result)

Source Code Output Details:

Students_names Students_marks

0 Suruthi 92

1 Monish Kumar 85

2 Dinesh Kumar 93

3 Hari Ram 88

4 Tharini 96

5 Antli Sumin 98

Python Basic Projects for Kids | Preshnave Muthukutty


Create plot using Matplotlib in Python

Configuration Details:

1. Problem Create normal plot using Matplotlib


2. Solver Python
3. Compiler Visual Studio Code Compiler

Source Code Details:

𝑖𝑚𝑝𝑜𝑟𝑡 𝑚𝑎𝑡𝑝𝑙𝑜𝑡𝑙𝑖𝑏. 𝑝𝑦𝑝𝑙𝑜𝑡 𝑎𝑠 𝑝𝑙𝑡


𝑖𝑚𝑝𝑜𝑟𝑡 𝑛𝑢𝑚𝑝𝑦 𝑎𝑠 𝑛𝑝
𝑥𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 = 𝑛𝑝. 𝑎𝑟𝑟𝑎𝑦([0,10])
𝑦𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 = 𝑛𝑝. 𝑎𝑟𝑟𝑎𝑦([0,200])
𝑝𝑙𝑡. 𝑝𝑙𝑜𝑡(𝑥𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒, 𝑦𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒)
𝑝𝑙𝑡. 𝑠ℎ𝑜𝑤()

Source Code Output Details:

Python Basic Projects for Kids | Preshnave Muthukutty


Create Bar Plot using Matplotlib in Python

Configuration Details:

1. Problem Create Bar plot using Matplotlib


2. Solver Python
3. Compiler Visual Studio Code Compiler

Source Code Details:

𝑖𝑚𝑝𝑜𝑟𝑡 𝑚𝑎𝑡𝑝𝑙𝑜𝑡𝑙𝑖𝑏. 𝑝𝑦𝑝𝑙𝑜𝑡 𝑎𝑠 𝑝𝑙𝑡


𝑖𝑚𝑝𝑜𝑟𝑡 𝑛𝑢𝑚𝑝𝑦 𝑎𝑠 𝑛𝑝

𝑥𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 = 𝑛𝑝. 𝑎𝑟𝑟𝑎𝑦(["𝐴", "𝐵", "𝐶", "𝐷"])


𝑦𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 = 𝑛𝑝. 𝑎𝑟𝑟𝑎𝑦([100,350, 500, 75])

𝑝𝑙𝑡. 𝑏𝑎𝑟(𝑥𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒, 𝑦𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒)


𝑝𝑙𝑡. 𝑠ℎ𝑜𝑤()

Source Code Output Details:

Python Basic Projects for Kids | Preshnave Muthukutty


Create Pie Plot using Matplotlib in Python

Configuration Details:

1. Problem Create Pie plot using Matplotlib


2. Solver Python
3. Compiler Visual Studio Code Compiler

Source Code Details:

𝑖𝑚𝑝𝑜𝑟𝑡 𝑚𝑎𝑡𝑝𝑙𝑜𝑡𝑙𝑖𝑏. 𝑝𝑦𝑝𝑙𝑜𝑡 𝑎𝑠 𝑝𝑙𝑡


𝑖𝑚𝑝𝑜𝑟𝑡 𝑛𝑢𝑚𝑝𝑦 𝑎𝑠 𝑛𝑝

𝑥 = 𝑛𝑝. 𝑎𝑟𝑟𝑎𝑦([100,350, 500, 450])


𝑚𝑦𝑙𝑎𝑏𝑒𝑙𝑠 = ["𝐸𝐸𝐸", "𝐸𝐶𝐸", "𝐶𝑆𝐸", "𝐼𝑇"]

𝑝𝑙𝑡. 𝑝𝑖𝑒(𝑥, 𝑙𝑎𝑏𝑒𝑙𝑠 = 𝑚𝑦𝑙𝑎𝑏𝑒𝑙𝑠, 𝑠𝑡𝑎𝑟𝑡𝑎𝑛𝑔𝑙𝑒 = 90)


𝑝𝑙𝑡. 𝑠ℎ𝑜𝑤()

Source Code Output Details:

Python Basic Projects for Kids | Preshnave Muthukutty

You might also like