DEV Community

Cover image for PYTHON 101; GETTING STARTED
Eric Mutua
Eric Mutua

Posted on

PYTHON 101; GETTING STARTED

** WHAT IS PYTHON**

First released in 1991 and created by Guido van Rossum, python is an interpreted, high-level and general-purpose programming language.

GETTING STARTED

Python Installation

You can download the various versions of python through your preferred browser(preferred versions 3.6+).

Python Installation
Clicking on download will download python.
Click on the..exe file to set up python in your computer

Writing the First Code
Open the Command Prompt and type python

CMD
You will be able to access Python.

print(Hello World)

FUNDAMENTALS OF PYTHON

Here we get to know Python;

  • Variables

  • Strings and Comments

  • Operators

  • Lists

  • Dictionaries

  • Sets

  • Functions

Variables

A variable is a storage location (Identified by the memory adress) paired with an associated symbolic name(an identifier), which contains some known or unknown quantity of information refered to as a value.

name= eric
age= 19
name and age are variables

Strings and Comments

# is used to convert a string to a comment

print("hello world")
#print ("Hello world")

Operators

There are different types of operators

  • Boolean
    Boolean values are two which are True or False

  • Comprison
    Comparison operators are

  1. Equal (==)
  2. Not equal (!=)
  3. Greater than (>)
  4. Less than (<)
  5. Greater or equal to (>=)
  6. Less than or equal to (<=)
  7. Logical and or not

Lists

Lists in python
In lists, characters are enclosed in brackets [].

Dictionaries

Items are stored in a key, value pair in a dictionary.
Dictionaries are defined using curly braces {} and are ordered.

Dictionaries in Python

Sets

Sets are defined using curly braces {} and are unordered.

ages = {19,20,21,22,23}
ages
{19,20,21,22,23}
Enter fullscreen mode Exit fullscreen mode

Functions

A function is a block of code that runs when it is called.
a function is defined with the def keyword.

def name():
    print('eric')

name()
eric
Enter fullscreen mode Exit fullscreen mode

Here, name() is calls the function to execute.

In Conclusion, that was an overview of getting strarted with python programming for beginners. As part of LUX Academy,i am happy to be here.

Top comments (2)

Collapse
 
ali_neema profile image
Susan Neema

This is so nice and informative. Looking forward for more.

Collapse
 
dbc2201 profile image
dbc2201

youtube.com/playlist?list=PLlrxD0H... Microsoft's Python Playlist