Pyhw 1
Pyhw 1
Program 1:
Print a table of 13.1 from 1 to 12
Solution:
Program 2:
Write a Python program to print the following string using the specific format (see the
output). Sample String : "Twinkle, twinkle, little star, How I wonder what you are! Up above
the world so high, Like a diamond in the sky. Twinkle, twinkle, little star, How I wonder what
you are"
Output :
Program 3
Write a Python program that calculates the area of a circle based on the radius entered by
the user. Hints : Define a function first. Import anything you need from the math module.
Solution:
r = float(input("enter radius of circle="))
enter radius of circle=34.562
>>> area = f'{3.14*r*r: 0.01f}'
>>> print("area of circle is=", area)