Follow

iklan banner
MASIGNCLEAN101

Python TYBBA (CA) Pratical Slip 6 Savitribai Phule Pune University

Python TYBBA (CA) Pratical Slip 6 Savitribai Phule Pune University
Mr PVK
March 31, 2025

 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 :




Share This :
Mr PVK
Write Your Response
:)
:(
hihi
:-)
:D
=D
:-d
;(
;-(
@-)
:P
:o
-_-
(o)
[-(
:-?
(p)
:-s
(m)
8-)
:-t
:-b
b-(
:-#
=p~
$-)
(y)
(f)
x-)
(k)
(h)
(c)
cheer
(li)
(pl)