[Part 1]Python 101! Introduction to Python Programming

titusnjuguna

Tito

Posted on July 23, 2021

[Part 1]Python 101! Introduction to Python Programming


Introduction to Python

Python is currently the most popular programming language in the tech world.Ranked among top 5 .

What makes Python Popular ?

For simplicity purpose, I will list some notable features of python that makes it popular:

  1. Ease of learning
  2. Open-source
  3. high-level language
  4. object-oriented and functional
  5. Interpreted
  6. Rich libraries

This can be attributed to its high abstraction level and its application in various fields.Briefly, below a various application of python :

  1. Data Science
  2. Automation
  3. Web development
  4. Artificial Intelligence and Machine Learning
  5. Game Development
  6. Software Development

Self-paced learning curriculum for zero-experienced programmer:

  1. Tools to get started
    • Integrated Development Environment(I.D.E):The purpose of these environment is write and run your code.There are quite a number of I.D.Es , I would highly recommend Visual Studio code.Download it
    • Python 3+ :Download python, I will highly recommend you get version 3.6 in consideration to your Operating System
    • Github : Github is a version control system that make coding efficient, through collaboration and tracking changes in your code.As a beginner, you need to SignUp on Github.To track changes locally,for absolute beginners,download Github Desktop(Windows Users) or Git BashTo learn more on git commands check out Git cheat sheet

    2.Python Fundamentals
    Basically, you should focus on the following:

    • Syntax – a syntax can be simply be defined as rules that define the structure of a programming language
    • Read the PEP 8 Rules: Basically , the document will give you coding conventions for the Python code.I would advise you to keep updated on the rules as the keep on evolving
    • Variables – it is a label that you can assign a value to it. And a variable always associates with a value.Example:
    •   welcome = 'Hello, World!'
        print(welcome)
      
    • where message is the variable.While naming your variables , it is important to note the following Rules
    • Strings – these are series of characters usually enclosed with single quotes and double quotes.From example below 'Hello ,world!' is a string.Additionally,numbers also can be string as long as they are enclosed in the quotes.
    •    welcome = 'Hello, World!'
         jant ='1234'
         print(welcome)
      
    • Note: As you learn about strings , there a various string operations that you need to understand.I will list a few:

      ** capitalize()- returns a string where the first character is upper case.Check out this example Google Collab

      ** count() - Returns the number of times a specified value occurs in a string. Check Google Collab
      ** endwith()-Returns true if the string ends with the specified value
      ** isnumeric() - Returns True if all characters in the string are numeric
      ** replace() - Returns a string where a specified value is replaced with a specified value
      String methods will improve your productivity as you build you embark on the journey to become Python Ninja.As I may not go through all the existing methods Read more

    • Constants – show you how to define constants in Python.
    • Comments – learn to give short description of what the code does.comments can be classified into:

      * Single line comment;written by placing '#' before the line e.g #the line declares a variable

      * Multiple line comment: conventionally,Python does not really have a syntax for multi line comments.Although you can opt to use '#' on every line you wish to comment or use tripple-double quotes at the opening and closing of the comment

    • Data Types:In python variables can be stored in various forms which in turn can be manipulated differently.

      * Numbers: Examples. Integers; 5,-4,99999
      Float;7.5,2e10(scientific notation).
      complex numbers; 2 + 3j
      Boolean;True , false

      * Strings

      * List

      * Tuple

      * Dictionaries

    • Data structures - used to store,organize and managing data efficiently.As a beginner, focus more on the built-in Data Structures. They are the building foundation for User-defined data structures

    • Functions:Simply , a function is a collection of organized and reusable code used to perform a task.They make coding easy and fast,and build basics of object oriented programming.In python a function is defined as refer here.Functions can be classified into two:User defined e.g Here or Built-in functions e.g Print()

    • 3.Object-oriented programming

      Object-oriented programming is aprogramming paradigm that provides a means of structuring programs so that properties and behaviors are bundled into individual objects.Basic,entities are defined as object At this level,you will focus on creating classes and principles of object-oriented programming:Encapsulation, Abstraction,Polymorphism,Inheritance


      At this level,you are ready to focus on your niche,as indicated above.As you learn ,always refer to Python Documentationfor detailed understanding

💖 💪 🙅 🚩
titusnjuguna
Tito

Posted on July 23, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related