# Create A Class With A Class Attribute A ; Create An Object From it And Set a Directly Using Object a=0 does # this charge the class attribute class Sample : a = " harry " obj = Sample () obj . a = " vikky " print ( Sample . a ) print ( obj . a ) print ( " Then Answer is this is not change the class attribute " )
write a class programme Of Calculator of Sqaure Root , Sqaure and Cube Of A Number class calculator : def __init__ ( self , num ) : self . number = num def square ( self ) : print ( f "the value of { self . number } square is { self . number ** 2} " ) def squareroot ( self ) : print ( f "the value of { self . number } square root is { self . number ** 0.5} " ) def cube ( self ) : print ( f "the value of { self . number } cube is { self . number ** 3} " ) a = calculator ( 25 ) a . square () a . squareroot () a . cube () output the value of 25 square is 625 the value of 25 square root is 5.0 the value of 25 cube is 15625