Python : Beginning "Hello World"
Hello Everyone !
I started learning Python the coding language in June 2025 and here are the following code that I leaned.
My First Code :
print("Hello World")
It was amazing, I haven't dowloaded Python, I'm doing this on online python.com it is amazing without much hustle.
Then I learned :
If condition
Basically if 5 is less than 6 it will print this but if I put 7 it will not.
Then :
Define Function that is "def"
It was easy but I still don't understand the f before Hello.
Then this :
print("challenge 1")
# Message for the user
message = "This is the message"
note = "please proceed"
print(message)
# perform math
result = 2*3
print(result)
print("challenge complete")
And got the result
Challenge 1
This is the message
6
Challenge Complete
Then Class function :
class puppy():
def __init__(self, name, favourite_toy):
self.name = name
self.favourite_toy = favourite_toy
def play (self):
print(self.name + " is playing with the " + self.favourite_toy)
bhura = puppy('bhura', 'cat')
bhura.play()
And got the result
bhura is playing with the cat.