Day 1
Introduction
You can download python
from here
or You can use online Code Editor like replit🧡
steps for windows
Step 1
step 2
do not forgot to add python to environment variable
step 3
Keep everything as default. And click finish.
manually adding environment variable
search environment variables on search
Click on Path and add new variable.
confirm
python --version
#output Python 3.11.4
What is Programming?
Programming is a way (one way due to AI you won’t need programming and through command prompt) to command computer. Due to AI boom according to Nvidia’s CEO you won’t be needing to learn programming to command computer. 🤷♀️
I dont know but Python🐍 is a one of the popular computer programming language which follows object oriented paradigm. Object oriented programming style suits for large project and help us implement DIY principle and make code more cleaner.
# model - variable
# price - variable
# self - instance of the calss
class Car: # constructor method
def __init(self,model,price): self.model = model self.price = price
Above code tell that hey python compiler I want to make a class🏛 Car(mode,price).
Which contains model and price.
Now one way to do it is create a seperate dictionary for every user. Which will be tedious and boring or better way to use OOP(object oriented programming).
# Create an object
Audi = Car("R8", 100000)
print(Audi.model) # R8
print(Audi.price) # 100000
note:
- It is good practice to use PascalCasing for classes.
more
- It was developed in 1989 by dutch programmer guido van rossum.
- The named was inspired from BBC tv show Monty Python’s Flying Circus.
- It is a general pupose programming and high level language.
Discover more from Coursity
Subscribe to get the latest posts sent to your email.