
Slip 6
A) Write python script using package to calculate area and volume of cube and sphere.
pi=22/7
radian = float(input('Enter radius of sphere: '))
sur_area = 4 * pi * radian **2
volume = (4/3) * (pi * radian ** 3)
print("Surface Area is: ", sur_area)
print("Volume is: ", volume)
def areaCube( a ):
return (a * a * a)
def surfaceCube( a ):
return (6 * a * a)
a = 5
print("Area =", areaCube(a))
print("Total surface area =", surfaceCube(a))
Program Output :
Enter radius of sphere: 7
Surface Area is: 616.0
Volume is: 1437.3333333333333
Area = 125
Total surface area = 150
B) Write a Python GUI program to create a label and change the label font style (font name, bold, size). Specify separate check button for each style.
import tkinter as tk
parent = tk. Tk ()
parent.title ("Welcome to Tybbaca student in SMBST College, Sangamner")
my_label = tk.Label (parent, text = "Hello",font = ("Arial Bold",35))
my_label.grid (column = 0, row = 0)
parent. mainloop ()
Program Output :
comment 0 Comment
more_vert