Python Basics
Python Programming Basics
Welcome to tutorial on Python Basics.
These series of Python Basic Examples cover all the Python basic programming concepts like conditional statements, looping statements, enum, datatypes, type conversion, etc.
These examples cover very basic concepts of programming. They introduce python syntax to the beginners.
Python Datatypes
Console Operations
The following tutorials gets us introduced to writing to and reading from standard console.
Conditional Statements
Conditionals statements help to implement branching instructions based on the result of a condition (usually a boolean expression). These conditional statements select a branch (or block of statements) statements among one or many.
- Python If Example - Execute a block of statements based on condition.
- Python If Else Example - Execute either of the block of statements, based on a condition.
- Python Elif Example - Ladder of If Else statements with a condition at each step.
- Python if and - Using logical AND Operator in IF statement's condition.
- Python if or - Using logical OR Operator in IF statement's condition.
- Python if not - Using logical NOT Operator in IF statement's condition.
Python Looping Statements
At times, you may need to repeat of set of instructions for a finite number of times or for each member of a collection. In these scenarios, Python looping statements help us.
- Python For Loop - Execute a block of code for each element in the collection.
- Python for i in range() - Execute a block of code for each number in the given Python Range.
- Python While Loop - Execute a block of code until a given condition fails.
Python Enumeration
- Python Enum Example - Usage of Enumerations in Python.
Python Type Conversion
These are some of the examples that demonstrate how to convert variable of a datatype to another.
- Python Convert Int to Float
- Python Convert Int to Complex Number
- Python Convert Int to String
- Python Convert Bytes to String
- Python Convert String to Int
Python Keywords
Following are examples that work with the list of Python Keywords.
- Python Pass Statement
- Check if the given String is a Python Keyword
- Get the list of all Python Keywords programmatically
Python Functions
- Python - Inner Functions
- Python - Return Function from Function
- Python - Return Tuple from Function
- Python - List of Functions
Python Advanced Topics
Summary
In this tutorial of Python Examples, we have gone through some of the most encountered and important Python Basics.