Skip to main content

How to Learn Coding Python?

 How to Learn Coding Python?

Python is a high-level, dynamic, object-oriented, interpreted and generally used in programming language. Guido Van Rossum designed this in 1991. It is used for web-development(sever-side), software development, mathematics, system scripting, artificial intelligence. Fortunately for beginners, Python has simple easy-to-use syntax. This makes Python an excellent language to learn to program for beginners. Python is a cross-platform programming language, which means that it can run on multiple platforms like Windows, MacOS, Linux, and has even been ported to the Java and .NET virtual machines. It is free and open-source. Version of python are Python 1, Python 2, Python 3 in that latest Version is Python 3.9.1.

Installation of Python 

  • Step 1: Select Version of Python to Install.

  • Step 2: Download Python Executable Installer.

  • Step 3: Run Executable Installer.

  • Step 4: Verify Python Was Installed On Windows.

  • Step 5: Verify Pip Was Installed.

  • Step 6: Add Python Path to Environment Variables (Optional)

  • Step 7: Install virtual Nv (Optional)

 

Before starting coding of Python you have to learn some basic about Python after that you will be writing own Python program quickly.

 

Step 1: Data Types And Variables

 

A data type is an attribute of data which tells the compiler (or interpreter) how the programmer intends to use the data. There are many data types like Numbers, Strings, Boolean, Lists, Tuples, Dictionary, Sets. Python provides three main data types are Number, String, Boolean.

  • String Type: str  For Example x = str("Hello World") 

  • Numeric Types: int , float , complex. For Example x = int(20), x = float(20.5), x = complex(1j)

  • Boolean Type: bool. For Example x = bool(5)

Variables 

Variables are containers for storing data values.

For Example:

x = 5

y= “john”

print (x)

print(y)

output

5

john

 

Step 2: Conditional Statements

A conditional statement is a Boolean expression that, if True, executes a piece of code. This is a great way to give your program some branching logic that controls the flow of code.

There are three types of conditional statements they are if, if-else, if-elif-else 

Step 3: Functions

A function is a block of code which only runs when it is called. In that you can also pass data into a function which is known as parameter. A function can return data as result. There are two type of function there are built-in function, user-defined function. 

User-Define Function

User defined functions are those that we define ourselves in our program and then call them wherever we want.


Built-In Functions 

Built-in functions are those that are already defined in Python libraries and we can call them directly.


Step 4: Loops 

Looping statement is the statements which execute one or more statement repeatedly several number of times. They are for loop, while loop.


For Loop

For loop is used to iterate over elements of a sequence. It is often used when you have a piece of code which you want to repeat "n" number of time. 


While Loop

While Loop is used to repeat a block of code. Instead of running the code block once, it executes the code block multiple times until a certain condition is met.

Step 5: Data Structures

A data structure is a particular way of organizing data in a compute so that it can be used effectively. They are two types, built-in data structure and user-defined data structure. 

Built-In Data Structure

Build-in data structure makes the programming easier and helps you to use them to obtain a faster solution. Almost 80% of real-world data is covered with these four data structures. It has four primary data structure that is list, tuples, dictionaries, set.

List

Most commonly used data structure in Python is List. It allows you to store elements of different data types in one container. 

For Example:

jon_snow = ["Jon Snow", "Winterfell, 30]

  print (jon_snow) # prints entire list 

  

  print (jon_snow[0]) # prints the first letter in the list

  

  print (len(jon_snow)) # prints the length of the list

Tuples

It is very similar to List with the difference of mutability. Once data is entered into tuples, it
cannot change, making tuple immutable. The size of the tuples is fixed. 

For Example:

car = ("Ford", "Raptor", 2019, "Red")

  print (car)

  

  print (len(car))

  

  print (car[1])

  

  print (car[2:])

Dictionaries

A dictionary stores key-value pairs, where each unique key is an index which holds the value associated with it. Dictionaries are unordered because the entries are not stored in a linear structure.

For Example:

empty_dict = {}

  print (empty_dict)

  

phone_book = {"Batman": 468426,

              "Cersei": 237734,

              "Ghostbusters": 44678}


print (phone_book)

Sets

Sets are used to store multiple items in a single variable. Set is one of 4 built-in data types in Python used to store collections of data, the other 3 are ListTuple, and Dictionary, all with different qualities and usage. A set is a collection which is both unordered and unindexed.

For Example:

thisset = {"apple", "banana", "cherry"}

print(thisset)

Are ready to begin your Python journey! There are many offline compilers and online compilers available. Logical think and constant practice will improve your Python skills and make you an expert. 

Happy Coding!


Popular posts from this blog

Using Controversy and Hype in Marketing. Sasikumar Talks.

  #sasikumartalks #controversy #hype #controversialmarketing #hypemarketing #overhypedgamer I want to talk about two things in this video: using controversy in marketing and whether it will be helpful for our business, and using hype for our marketing. I asked this question to ChatGPT and it has given some excellent answers. I want to share that with you. Controversy in marketing can be a useful tool for some businesses, but it can also be risky. I have seen some businesses use this concept of using controversy in marketing and achieve success, but for established brands or businesses, it can be risky. When you create a controversy, people will talk about it, but it may also divert attention from the product or service and the focus will be on the conversation or debate. So, it is important to think twice and prepare for any potential negative consequences before using controversy in marketing. Using hype in marketing can also be risky. If the product or service is reall...

Lead Generation Using Blog - Sasikumar Talks

1. Introduction to Lead Generation Through Blogs In the digital age, lead generation remains a cornerstone of successful business strategies, offering a pathway to attract and engage potential customers. Blogs, with their rich content and SEO capabilities, emerge as powerful tools in this endeavor. When harmonized with Google Search Ads, blogs transcend traditional boundaries, targeting users with precision and converting interest into actionable leads. 2. The Importance of Long-Tail Keywords Long-tail keywords are crucial in attracting a specific audience. These keywords, characterized by their length and specificity, align closely with user intent, making them invaluable for blogs aiming to capture leads. By focusing on these detailed phrases, businesses can tap into niche markets with higher conversion potentials. 3. Integrating Google Search Ads into Your Blog Strategy Google Search Ads offer a dynamic platform to enhance blog visibility. By utilizing search ads, businesses can pro...

SendGrid. Email Software. Sasikumar Talks

  SendGrid. Email Software. Sasikumar Talks #sendgrid #sendgridtamil SendGrid is an email software and email delivery platform that enables businesses to send and manage large volumes of email communications, such as marketing campaigns, transactional emails, and automated email sequences. It provides businesses with a cloud-based infrastructure for sending and tracking emails, which enables them to send large volumes of email at scale, with high deliverability and minimal latency. The main features of SendGrid include: Email sending and delivery: SendGrid provides businesses with a cloud-based infrastructure for sending and delivering large volumes of email. It uses a variety of techniques to ensure high deliverability rates, such as real-time analytics and tracking, email list cleaning, and email authentication. Email marketing automation: SendGrid includes a range of tools for automating email marketing campaigns, such as triggered email sequences and drip campaigns. These t...