Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
errors in code
#1
I'm getting a TypeError. I want to call out my initialised parameters

Code:
class Students:
	def _init_(self, name,age,grade):
		self.name = name
		self.age = age
		self.grade = grade

		
student1 = Students("Bob", 12, "7th")
Error:
Error:
Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> student1 = Students("Bob", 12, "7th") TypeError: this constructor takes no arguments
Reply


Messages In This Thread
errors in code - by sylvie1987100 - Jul-19-2019, 10:36 AM
RE: errors in code - by buran - Jul-19-2019, 10:56 AM
RE: errors in code - by ndc85430 - Jul-20-2019, 06:04 AM
RE: errors in code - by sylvie1987100 - Sep-11-2019, 12:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Are there errors in the code for my coin toss systems? Matlibplot is too perfect . Coolkat 0 342 Nov-13-2023, 11:54 AM
Last Post: Coolkat
  My code won't say Player wins or computer wins. No errors. its_a_meLuigi64 2 1,585 Dec-01-2021, 04:43 PM
Last Post: its_a_meLuigi64
  Rmarkdown opened by python code - errors Rav013 0 2,048 Apr-27-2021, 03:13 PM
Last Post: Rav013
  [split] Kera Getting errors when following code example Image classification from scratch hobbyist 3 4,546 Apr-13-2021, 01:26 PM
Last Post: amirian
  2 errors in code numbnumb54 2 1,971 Jul-24-2020, 02:28 PM
Last Post: Marbelous
  Code errors rhyjom 0 1,432 Jun-21-2020, 04:50 PM
Last Post: rhyjom
  Errors in code coolcassie 2 2,057 Dec-03-2019, 12:10 AM
Last Post: coolcassie
  Errors trying to run code ziggyztz 3 3,579 Nov-03-2019, 04:24 AM
Last Post: newbieAuggie2019
  Decorator toy code throws syntax errors kevinxhi 3 3,520 Sep-04-2017, 03:01 AM
Last Post: kevinxhi

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020