Category: 1. Fundamentals

  • Python Type Conversion

    Summary: in this tutorial, you’ll learn about type conversion in Python and some useful type conversion functions. Introduction to type conversion in Python To get input from users, you use the input() function. For example: When you execute this code, it’ll prompt you for input on the Terminal:Enter a value: If you enter a value, for example,…

  • Python Comments

    Summary: in this tutorial, you’ll learn how to add comments to your code. And you’ll learn various kinds of Python comments including block comments, inline comments, and documentation string. Introduction to Python comments Sometimes, you want to document the code that you write. For example, you may want to note why a piece of code…

  • Python Constants

    Summary: in this tutorial, you’ll learn how to define Python constants. Sometimes, you may want to store values in variables. But you don’t want to change these values throughout the execution of the program. To do it in other programming languages, you can use constants. The constants are like variables but their values don’t change during…

  • Python Boolean

    Summary: in this tutorial, you’ll learn about the Python boolean data type, falsy and truthy values. Introduction to Python Boolean data type In programming, you often want to check if a condition is true or not and perform some actions based on the result. To represent true and false, Python provides you with the boolean…

  • Python Numbers

    Summary: in this tutorial, you’ll learn about Python numbers and how to use them in programs. Python supports integers, floats, and complex numbers. This tutorial discusses only integers and floats. Integers The integers are numbers such as -1, 0, 1, 2, and 3, .. and they have type int. You can use Math operators like +, -, *, and /…

  • Python String

    Summary: in this tutorial, you’ll learn about Python string and its basic operations. Introduction to Python string A string is a series of characters. In Python, anything inside quotes is a string. And you can use either single or double quotes. For example: If a string contains a single quote, you should place it in…

  • Python Variables

    Summary: in this tutorial, you’ll learn about Python variables and how to use them effectively. What is a variable in Python When you develop a program, you need to manage values, a lot of them. To store values, you use variables. In Python, a variable is a label that you can assign a value to…

  • Python Syntax

    Summary: in this tutorial, you’ll learn about the basic Python syntax so that you can get started with the Python language quickly. Whitespace and indentation If you’ve been working in other programming languages such as Java, C#, or C/C++, you know that these languages use semicolons (;) to separate the statements. However, Python uses whitespace and indentation…