Example HTML page

Python Exercise 18


Please do the following programs. The questions are based on Python Classes.

1.Write a python program to find the following by using functions inside a class.

  1. pow(4,-3)
  2. pow(-2,0)
  3. pow(-1,-1)
  4. pow(0,9)

2.Write a python program to reverse a string word by word by using functions inside a class. Suppose, if the string s= ‘here is Sudhakar’ and your output must be ‘Sudhakar is here’.

3.Create a class as ‘triangle’. Using functions inside that triangle class, pass essential parameters into it and check the number of sides, angles of that triangle.(if need use __init__ method).

4.Create a class ‘Circle’ and using __init__ method to initialize that class ‘Circle’ with radius. Generate two methods inside the class to find area and circumference of the circle.

5.Write a python program to create a class that prints the string in uppercase by using functions inside the class.



Example HTML page

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest