Python Exercise 18
Hi,
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.
- pow(4,-3)
- pow(-2,0)
- pow(-1,-1)
- 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.