0% found this document useful (0 votes)
11 views13 pages

Python Assignment

The document outlines a series of practical programming exercises using Python, aimed at problem-solving skills. Each exercise includes a specific task, such as calculating the area of a triangle or checking if a number is odd or even. The document serves as a guide for students in a programming course (24CSE0101) to practice and implement various Python programs.

Uploaded by

dg 2006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views13 pages

Python Assignment

The document outlines a series of practical programming exercises using Python, aimed at problem-solving skills. Each exercise includes a specific task, such as calculating the area of a triangle or checking if a number is odd or even. The document serves as a guide for students in a programming course (24CSE0101) to practice and implement various Python programs.

Uploaded by

dg 2006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Problem Solving using Python Programming (24CSE0101)

INDEX
Sr. Practical Name Teacher Sign
No.

1 Write a Python program to Calculate the Area of a


Triangle.

2 Write a Python program to Swap Two Variables

3 Write a Python program to Convert Celsius to Fahrenheit

4 Write a Python program to Check if a Number is ODD or


Even.

5 Write a Python program to Check if a Number is Positive


Negative or 0.

6 Write a Python program to Check Amstrong number

7 Write a Python program to Check if a Number is


Fibonacci number

8 : Write a Python program to print cube sum of first n


natural numbers.

9 Write a Python program to print all odd numbers in a


range

10 Write a Python program to print pascal triangle

11 Write a program to draw the following pattern for n numbers

Problem Solving using Python Programming (24CSE0101) Page 1


Problem Solving using Python Programming (24CSE0101)

Program 1: Write a Python program to Calculate the Area of a


Triangle.
Solution:

Output:

Problem Solving using Python Programming (24CSE0101) Page 2


Problem Solving using Python Programming (24CSE0101)

Program 2: Write a Python program to Swap Two Variables.

Solution:

Problem Solving using Python Programming (24CSE0101) Page 3


Problem Solving using Python Programming (24CSE0101)

Output:

Problem Solving using Python Programming (24CSE0101) Page 4


Problem Solving using Python Programming (24CSE0101)

Program 3: Write a Python program to Convert Celsius to Fahrenheit

Solution:

Output:

Problem Solving using Python Programming (24CSE0101) Page 5


Problem Solving using Python Programming (24CSE0101)

Program 4: Write a Python program to Check if a Number is ODD or


Even.
Solution:

Output:

Problem Solving using Python Programming (24CSE0101) Page 6


Problem Solving using Python Programming (24CSE0101)

Program 5: Write a Python program to Check if a Number is Positive


Negative or 0.
Solution:

Output:

Problem Solving using Python Programming (24CSE0101) Page 7


Problem Solving using Python Programming (24CSE0101)

Program 6: Write a Python program to Check


Amstrong number
Solution:

Output:

Problem Solving using Python Programming (24CSE0101) Page 8


Problem Solving using Python Programming (24CSE0101)

Program 7: Write a Python program to Check if a Number is


Fibonacci number
Solution:

Output:

Problem Solving using Python Programming (24CSE0101) Page 9


Problem Solving using Python Programming (24CSE0101)

Program 8: Write a Python program to print cube sum of first n


natural numbers.
Solution:

Output:

Problem Solving using Python Programming (24CSE0101) Page 10


Problem Solving using Python Programming (24CSE0101)

Program 9: Write a Python program to print all odd numbers in a


range
Solution:

Output:

Problem Solving using Python Programming (24CSE0101) Page 11


Problem Solving using Python Programming (24CSE0101)

Program 10: Write a Python program to print pascal


triangle
Solution:

Output:

Problem Solving using Python Programming (24CSE0101) Page 12


Problem Solving using Python Programming (24CSE0101)

Program 11: Write a program to draw the following


pattern for n numbers
|11111|
|2222 |
|333 |
|44 |
Solution:

Output:

Problem Solving using Python Programming (24CSE0101) Page 13

You might also like