Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19

CSE – Problem Solving

Assignment 2
Om Singh (20BCE10990)
Python Code Exercise

Table of Contents
PROBLEM 1 :-...................................................................................................2
PROBLEM 2 :-...................................................................................................3
PROBLEM 3 :-...................................................................................................4
PROBLEM 4 :-...................................................................................................5
PROBLEM 5 :-...................................................................................................7
PROBLEM 6 :-...................................................................................................8
PROBLEM 7 :-...................................................................................................9
PROBLEM 8 :-.................................................................................................10
PROBLEM 9 :-.................................................................................................11
PROBLEM 10 :-..............................................................................................12
PROBLEM 11 :-..............................................................................................13
PROBLEM 12 :-..............................................................................................14
PROBLEM 13 :-..............................................................................................15
PROBLEM 14 :-..............................................................................................16
PROBLEM 15 :-..............................................................................................17
PROBLEM 16 :-..............................................................................................18
PROBLEM 17 :-..............................................................................................19
Problem 1 :-
Write a python program to print Hello World! :
Problem 2 :-
Write a python program to add two numbers :
Problem 3 :-
Write a python program to find the square root :
Problem 4 :-
Write a python program to calculate the area of a triangle :
Problem 5 :-
Write a python program to convert kilometres to miles:
Problem 6 :-
Write a python program to convert Celsius to Fahrenheit:
Problem 7 :-
Write a python program to check if a number is positive,
negative or 0 :
Problem 8 :-
Write a python program to check if a number is odd or even :
Problem 9 :-
Write a python program to find the largest among three
numbers :
Problem 10 :-
Write a python program to check a prime number:
Problem 11 :-
Write a python program to display the multiplication table :
Problem 12 :-
Write a python program to count odd and even numbers:
Problem 13 :-
Write a python program to compute the sum of n natural
numbers:
Problem 14 :-
Write a program to print ‘Hello’ 5 times:
Problem 15 :-
Write a python program to find the area of a circle:
Problem 16 :-
Write a python program to find the age validity (valid voter
or not):
Problem 17 :-
Write a python program to find the sum of first 100 natural
numbers:

You might also like