Sitemap
Guhan prijesh

Guhan prijesh

SDV Engineer | IT Grad | Engineer | Tech enthusiast | Interested in learning | Eager to explore | Problem Solving

Python basics blog

3 min readJul 26, 2022

--

Python

What is Python?

It’s actually a High level interpreted programming language developed by GUIDO VAN ROSSUM, inspired by his favorite show(“Flying circus”)MONTY PYTHON” in 1989.

Python is Easy to learn, open source,having large standard library and oops with easy syntax and dynamic semantics.Also it’s slow from other programming languages.

Features of Python:

It’s simple open source Portability Embedded and Extensible, Interpreted, Huge libraries, OOPS(object oriented).

Who uses Python

That it’s almost used by most of the companies, like Google, Dropbox, BitTorrent, RaspberryPi, NASA, National Security Agency, YouTube, NETFLIX. Python is almost used in all fields like software development, server side, etc.,

Installing Python

To use python in your local system, you have to install it. So download it form python.org and install it into your system and don’t forget to add it into environment path variables to access it from anywhere on your computer. Also confirm that it’s installed properly in your system through the python — version in command prompt. Then use an IDE for writing programs in python, I prefer Visual Studio Code for python, it is more user friendly and easy to use.

Python programming

Open VS code then in new file start your programming with print statement as print(“Hi everyone”) then save it as file_name.py with .py extension

Data types and Variables

Variables are the placeholders that hold the seperate amount of space in memory that based on their datatype. The datatype is the main factor that tells the machine about the type of the data and then the functionalities based on the type is restricted to the data.

Get Guhan prijesh’s stories in your inbox

Join Medium for free to get updates from this writer.

The Datatypes in Python are;

  • Numeric- int for storing numbers as integers, float for storing decimal numbers, also complex as real and imaginary numbers. Ex: a=5, b=5.6, c=6+6j
  • Lists is a Collection of heteroegeneous data and it is MUTABLE, it must be enclosed in array brackets.
  • Tuple is a collection of heterogeneous data and it is IMMUTABLE, it must be enclosed in paranthesis.
  • Dictionary is a collection of Key and value pairs, need to be enclosed in curly braces).
  • Sets, it is a set of unique values not duplicate values, need to be enclosed in curly braces but only unique values if you store duplicate values in it, it will automatically remove it while processing.
  • Strings — Strings is a datatype that stores any values but it needs to be enclosed in single or double quotes. if there is an multiple lines sentences then enclose it in triple single or triple double quotes. it is immutable but there are some built in functions to process the string.

Operators in python

The operators are used in python as constructs

Press enter or click to view image in full size

Conditionals and loops:

  • if, if-else, if-elif-else
  • for loop
  • while loop

Python functions:

def my_function():
print(“Hello from a function”)

  • In Python a function is defined using the def keyword.
  • To call a function, use the function name followed by parenthesis
  • Information can be passed into functions as arguments.

--

--

Guhan prijesh
Guhan prijesh

Written by Guhan prijesh

SDV Engineer | IT Grad | Engineer | Tech enthusiast | Interested in learning | Eager to explore | Problem Solving