xFactorSchool.com
Python
JavaScript
How to Do Examples
C Examples
Python Examples
HTML Examples
Code Examples
C Code Examples
C++ Code Examples
C# Code Examples
Java Code Examples
Python Code Examples
HTML Code Examples
CSS Code Examples
JavaScript Code Examples
Online Compilers
C Compiler
C++ Compiler
C# Compiler
Java Compiler
Python Compiler
HTML Code Editor
CSS Code Editor
JavaScript Compiler
JavaScript Code Editor
Practice how to create a class constructor with parameters in Python
Python Online Editor
Execute Code
More Python Sample Codes
# Declaring a class class Person: def __init__(self, name, age): # class constructor method ( __init__) self.Name = name self.Age = age # Create an instance of Person class with the constructor personObj = Person("John", 25) print(personObj.Name + " is " + str(personObj.Age) + " years old.")