Sponsor Area

NCERT Solutions for Class 12 Help.html Computer Science With Python Chapter 3 Classes In Python

Classes In Python Here is the CBSE Help.html Chapter 3 for Class 12 students. Summary and detailed explanation of the lesson, including the definitions of difficult words. All of the exercises and questions and answers from the lesson's back end have been completed. NCERT Solutions for Class 12 Help.html Classes In Python Chapter 3 NCERT Solutions for Class 12 Help.html Classes In Python Chapter 3 The following is a summary in Hindi and English for the academic year 2025-26. You can save these solutions to your computer or use the Class 12 Help.html.

Question 1
CBSEENCO12011539

Define a class RING in Python with following specifications

Instance Attributes
- RingID 		# Numeric value with a default value 101
- Radius 		# Numeric value with a default value 10
- Area 			# Numeric value
Methods:
- AreaCal() 	# Method to calculate Area as
				# 3.14*Radius*Radius
- NewRing() 	# Method to allow user to enter values of
				# RingID and Radius. It should also
				# Call AreaCal Method
- ViewRing() 	# Method to display all the Attributes 4

Solution
class RING: # OR class RING( ): OR class RING(Object):
	def __init__(self):
		self.RingID=101
		self.Radius=10
		self.Area=0
	def AreaCal(self):
		self.Area=3.14*self.Radius*self.Radius
	def NewRing(self):
		self.RingID=input('Enter RingID')
		self.Radius=input('Enter radius')
		self.AreaCal() # OR AreaCal(self)
	def ViewRing(self):
		print self.RingID
		print self.Radius
		print self.Area

Sponsor Area