how to use python code example

Example 1: how to get started with python

#the best way to start with anything is not to rush and start with the basics
#python however is really good for begginers as it is easy to read and understaned
#and has relatively easy syntax so dont spend a lot of time on the basics like
#print() and if  rather learn the basics and learn about the libraries 
#and a good way to learn about the libraries is https://pypi.org/ if you are also
#struggling to find motivation for programming the best way to work around it is
#to learn how dopamine works in your brain and how to use it in progoramming
#for that use the video https://www.youtube.com/watch?v=9QiE-M1LrZk
#for a good IDE i reccomend pycharm
#and remember programming is not something you should remember to be good 
#programming is something you need to understand and to be a good programmer you 
# need to know how to put the internet to a good use and to know where to search

#if this helped leave it an upvote 
#rubel1130 :)

Example 2: why use python

#Hello world in Java:
public class Main {
    public static void main(String[] args) {
        System.out.println("hello world");
    }
}

#Hello world in Python:
print('hello world')

#See?

Example 3: how to learn python

"""
Great foundation for basics 
https://www.w3schools.com/python/default.asp"
"""

Example 4: how to learn python

# Basic python sum calculator

# If you know how to use function, you can use it, but for starters I will not use it

number_first = input("Please input fisrt number: ") # input() is used to take user input
number_second = input("Please input second number: ") # input() is used to take user input

# There is two way to add two numbers

print(sum((number_first, number_second))) # print() used to print stuff. # sum() takes tuple and sum the two or more numbers in it.
print(number_first + number_second) # print() used to print stuff. This method is easier and just make you do simple math.

=========================================================
# Output:
Please input fisrt number: 1
Please input second number: 7

>>> 8 # sum() printed
>>> 8 # second method printed

Example 5: python how to use oop

#Object oriented programming is when you create your own custom class.
#One reason you should do this is that is saves you time.
#Another reason is it makes calling certain functions easier with tkinter

class Dog:
  #init creates certain parameters that allow you to define information quickly.
  def __init__(self, name):
    self.name = name
    
  def get_name(self):
	return self.name
    
if __name__ == "__main__":
  d = Dog(str(input("name your dog: "))
  print(d.get_name())

Example 6: how to learn python

Oh I see u wanna learn Python its preety easy :D