0% found this document useful (0 votes)
8 views

Project

Uploaded by

Soumya Bishnu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Project

Uploaded by

Soumya Bishnu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Shri ShikShayatan College

ankita daS
roll no-36

geography department
SubjeCt : python programming : lab aSSignment
date:
INDEX

Sl.No: Assignment Name Page


1 Write a program in Python to check whether a 3
given character is vowel or consonant
2 Write a Program in Python to swap two numbers 4
3 Write a Python program to find smallest rumber 5
among three.
4 Write a program to find whether a person 6
having fever or not.
5 Write a Program in Python to convert Fahrenheit 7
into Celsius.
6 Write a Python program to check if a number is 8
Even or Odd.
7 Write a program in Python to find your grade 9
according to the following condition
a. Above 90 - grade Outstanding
b. Above 80- grade A
c. Above 70 - grade B
d. Above 60 -- grade C
e. Otherwise Fail.
8 Write a Python program to print the Summation 10
of the following series:
2+4+6+8+10+12+14

2
Assignment -1
Problem Statement: Write a program in Python to check whether a
given character is vowel or consonant.
Flowchart:

Code:
char = input("Enter a character: ")
if char in 'aeiouAEIOU':
print(char, "is a vowel.")
else:
print(char, "is a consonant.")
Output:

3
Assignment -2
Problem Statement: Write a Program in Python to swap two numbers.
Flowchart:

Code:
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
print("Before swapping: a =", a, "b =", b)
a, b = b, a
print("After swapping: a =", a, "b =", b)
Output:

4
Assignment -3
Problem Statement: Write a Python program to find smallest number
among three.
Flowchart

Code
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
c = int(input("Enter third number: "))
if a <= b and a <= c:
smallest = a
elif b <= a and b <= c:
smallest = b
else:
smallest = c
print("The smallest number is", smallest)

Output

5
Assignment -4
Problem Statement: Write a program to find whether a person having
fever or not.
Flowchart

Code
temperature = float(input("Enter your body temperature in Celsius: "))
if temperature >= 38.0:
print("You have a fever.")
else:
print("You do not have a fever.")

Output

6
Assignment -5
Problem Statement: Write a Program in Python to convert Fahrenheit
into Celsius
Flowchart

Code
fahrenheit = float(input("Enter the temperature in Fahrenheit: "))
celsius = (fahrenheit - 32) * 5 / 9
print(f"{fahrenheit} Fahrenheit is equal to {celsius:.2f} Celsius")

Output

7
Assignment -6
Problem Statement: Write a Python program to check if a number is
Even or Odd.
Flowchart

Code
number = int(input("Enter a number: "))
if number % 2 == 0:
print(number, "is even.")
else:
print(number, "is odd.")

Output

8
Assignment -7
Problem Statement: Write a program in Python to find your grade according
to the following condition
a. Above 90 - grade Outstanding
b. Above 80- grade A
c. Above 70 - grade B
d. Above 60 -- grade C
e. Otherwise Fail.
Flowchart

Code
score = int(input("Enter your score: "))
if score > 90:
grade = "Outstanding"
elif score > 80:
grade = "A"
elif score > 70:
grade = "B"
elif score > 60:
grade = "C"
else:
grade = "Fail"
print("Your grade is:", grade)
Output

9
Assignment -8
Problem Statement: Write a Python program to print the Summation
of the following series:
2+4+6+8+10+12+14
Flowchart

Code
n = int(input("Enter the value of n: "))
total_sum = 0
for i in range(2, n + 1, 2):
total_sum += i
print(f"The sum of the series is: {total_sum}")
Output

10

You might also like