How to Learn Python Fast : Quickly Learn Python Basics

How to Learn Python Fast _ Quickly Learn Python Basics

Python is very popular and demanding language. You will see every new programmer likes to learn a programming language in python only. According to the stack overflow survey, python programming language is the most wanted language. In addition, the Python programming language has a large community that makes it more popular. But one question comes in mind of every new or existing programmer how to learn python? How to learn python fast? The answer to these questions is here. In this article, you will know how to learn python fast and what are the resources available online for learning python programming language. So friends lets get started.

How to Learn Python Fast if you are new?

If you are a beginner in programming field or have not any knowledge of any programming skills, then this sections is for you. After reading the article you will come to know how to learn python fast in two different perspectives. one for people who currently want to learn python fast part timely and other who wants to learn for a full time.

Part-time Python Programming Language  Learner

If you want to learn python basics as a part-time learner, then you should start learning python in the ordered I had mentioned in this section. I have also described the following educational resources and reviews for learning. You will come to know that you will feel very excited and entertaining as you proceed through the steps.

Step 1. – Download the Pycharm tool and install it on your personal computer.  Make sure to download the community edition as it is free.

Step 2 – Code the First Hello World Programme and run it.

print("Hello World!")

Step 3 – How to declare variable and types of the variable in the Python language.

You can declare use any variable name, but it should start with lowercase and camel case. Camel case means if a variable name contains more than two words then use it. For example ‘printWorld’ it has two words in print and the world.

Type of Variable in Python

  1. Numbers
  2. Strings
  3. Lists
  4. Tuples
  5. Sets
  6. Dictionary

Below is the syntax for the all these types of variable.

num = 10 #Number

string = "Data Science Learner" # String are enclosed inside double(Best Practices) or single quotes.

list = [10,20,0,"Python",30.4] #List

tuples = ('Data Science',2,4) #tuples

set = {1,2,3,4,5} #sets

dictionary =  {"key1":"value1" , "Name": "John", "Age":26} #Dictionary

Other Basics

Python Input and Output

If you want to take input from the user then the syntax is below.

variable_name = input("Enter your name:")   #take input as a string

number = int(input("Enter your age:") #take input as a number

Python Output

You can use the print() function for printing any output.

dictionary ={"key1":"value1" , "Name": "John", "Age":26}
num = int(input("Enter number:"))
print(dictionary) #print the dictionary
print(num) #print the number

Output

Enter number:20
{'key1': 'value1', 'Name': 'John', 'Age': 26}
20

 

Python Operators

Arithmetic Operators

1. ” + ” , Add the values.

2. ” – “, Subtract the values.

3. ” * ” , Multiply the values.

4. ” / “, Divide the left operand by the right operand to get the quotient.

5. ” % “,  It divides the left operand by the right operand and returns the remainder.

6. ” ** ” , It does exponential power to the operators.


num1 = int(input("Enter number1:"))
num2 = int(input("Enter number2:"))
#addition
add = num1 + num2
#substraction
sub = num1-num2
#multiplication
mul = num1*num2
#division
div = num1/num2
#modulus
mod =num1%num2
# Exponential power
pow = num1**2

print(add)
print(sub)
print(mul)
print(div)
print(mod)
print(pow)

Output

Enter number1:10
Enter number2:20
30
-10
200
0.5
10
100

Logical Operators

1. ” = = “, It returns the true if the values of the two operands are equal.

2. ” !=  ” , Returns the true if the operands are not equal.

3. ” < ” , This operator will return true if the left operand is less than the right operand.

4. ” > ” , Returns true if the left operand is greater than the right operator.

5. ” <>”,  It returns the true if operands are not equal, it is the same as ” !=”. Python 3,6+ doesn’t support it.

6. ” >= “, Returns the true if the left operand is equal and greater than the right operand.

7. ” <=” , It will return true if the right operand is equal and greater than left operand.


num1 = int(input("Enter number1:"))
num2 = int(input("Enter number2:"))
#l1: ==
l1 = num1 == num2
#l2:!=
l2 = num1!=num2
#l3: <
l3 = num1<num2
#l4: >
l4 = num1>num2
#l5: >=
l5 = num1>=num2
#l6: <=
l6 = num1<=num2
print(l1)
print(l2)
print(l3)
print(l4)
print(l5)
print(l6)

Output

Enter number1:20
Enter number2:30
False
True
True
False
False
True

Loops in Python

for loop

#list
list = [10,20,0,"Python",30.4] #List
#for loop
for l in list:
    print(l)

Output

10
20
0
Python
30.4

while loop

# while loop
count =0
while(count<len(list)):
    print(list[count])
    count =count+1

Output

10
20
0
Python
30.4

Functions in Python

In this section, you will learn how to create a function in python.

#define the function for the sum
def sum(num1,num2):
    return num1+num2


num1 = int(input("Enter number 1:")) #num1
num2 = int(input("Enter number 2:")) #num2

result = sum(num1,num2) #result
print(result) 

Output

Enter number 1:12
Enter number 2:13
25

Python Decision Making

You can use decision making with three types

Simple if statement

number = 100
if (number == 100): print ("number is 100")

Output

number is 100

if…else  statement

number = int(input("Enter the number"))
if (number == 100):
print ("number is 100")
else :
print("It is a different number")

Output

Enter the number100
number is 100

Nested if Statement

number = int(input("Enter the number"))
if (number == 100):
    print ("number is 100")
elif (number ==200) :
    print("Number is 200")

elif (number ==500):
    print("Number is 500")
else:
    print("It is a different number")

Output

Enter the number500
Number is 500

Some other Python Basic tutorials

How to Create a List in Python – (Index, Append, Reverse, Slicing )

Compare Lists in Python : 3 Code Tweaks with Swapping, Deletion

Split a String In Python : 2 Methods and Code Tweaks

Create a Dictionary in Python: 4 Code Tweaks ( Conversion, Merging )

OOPS in Python Tutorial with 3 Basic Examples ( Inheritance)

Above are all the basics of the python you should know before continuing to moving to learn at the intermediate level and advanced level.

Python Video Tutorials article has the list of all the python video tutorials you can refer to learn more about Python programming language.

Conclusion

Python is very popular and trendy programming language. If you are new in the programming field then I will suggest you start with python. How to learn Python fast article will first, let you know all the generally used basics and then you will get the list of the best popular python video courses on the Python Programming language.

If you want to use to make some changes to this article, please comment us or contact us for adding your suggestions.

Data Science Learner Team

 

Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for signup. A Confirmation Email has been sent to your Email Address.

Something went wrong.

Meet Sukesh ( Chief Editor ), a passionate and skilled Python programmer with a deep fascination for data science, NumPy, and Pandas. His journey in the world of coding began as a curious explorer and has evolved into a seasoned data enthusiast.
 
Thank you For sharing.We appreciate your support. Don't Forget to LIKE and FOLLOW our SITE to keep UPDATED with Data Science Learner