Python for programmers that know a different language

Python for programmers that know a different language

Table of contents

I have assumed that before starting this series to learn Machine learning you know some basics of any programming language, if you know that then the rest will be a lot easy.

You will learn python in no time.

Basic python commands

  1. The print function

     print("Hello I am Learning ML")
     print(8+2) #printing number directly
    
  2. Basic Data Types

     #1. int
     type(8)
    
     #2. float
     type(8.3)
    
     #3.str
     type("english")
    
  3. Constant and Variables

     #assing a value in a variable named language
     language = "Python"
     print(language)
    
     #it can be reassigned 
     language = "JavaScript"
     print(language)
    
  4. Input Function

     number_1 = int(input("Enter the first number : "))
     number_2 = int(input("Enter the second number : "))
    
     sum = number_1 + number_2
     print(sum)
    
     #We can also change datatype of a variable
     num = 5
     print(float(num)) #prints 5.0
    

    In the next article, we will look into some basic data types in python.

    Thanks for reading, Have a nice day ahead.