-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathskeleton_Code.py
More file actions
30 lines (25 loc) · 785 Bytes
/
skeleton_Code.py
File metadata and controls
30 lines (25 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# This is the code to Print Hello World in Python
# No Need to Import modules yet!!
print("Hello world")
#
#
# D O N E !!
#
#
# This Code is for A Simple Class declaration and Object creation:
# Example:
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def introduce(self):
print(f"Hello, my name is {self.name} and I am {self.age} years old.")
# Creating objects of the Person class
person1 = Person("Alice", 25)
person2 = Person("Bob", 30)
# Accessing object properties
print(person1.name) # Output: Alice
print(person2.age) # Output: 30
# Calling object methods
person1.introduce() # Output: Hello, my name is Alice and I am 25 years old.
person2.introduce() # Output: Hello, my name is Bob and I am 30 years old.