Category Archives: Python Programming Language

Python Convert Binary Number to Decimal

Python Convert Binary Number to Decimal – This Python tutorial gives the basic logic to convert a binary number into its corresponding decimal number. The image number 1 shows the whole binary to decimal number conversion process . The Python source code to convert a binary number into decimal # This Python script / program… Read More »

Loading

Python Ternary Operator or Conditional Expressions

Python Conditional Expression is also called Ternary Operator. It is an alternative to a simple Python if else statement. Syntax of Python Ternary Operator or Conditional Expressions x  if   C   else   y Where x is a simple Python expression or statement. The C represents a given condition. The y represents another simple… Read More »

Loading

Python User Defined and Built-in Functions – Defining and Using Functions

‘Python User Defined and Built-in Functions – Defining and Using Functions’ is our Python tutorial to explain the use of Python functions in Python programs / scripts. We will cover the following topics on Python Functions: Python Functions Defining and Using Functions What is a Function? Importance of Functions Advantages of  Using Functions Types of… Read More »

Loading

Python Variable Names and Naming Rules

Python Variable Names and Naming Rules is a Python tutorial to explain the rules and importance of choosng good names for your variables in a program. Choose Short but Meaningful Variable Names Python Variable names shoud be short but meaningful. It will add in program readability. For example, ‘num’ is a better variable name than… Read More »

Loading

Python if elif else Statement with Example Programs

Python if elif else Statement decides to select only one block of statements from many given block of statements. It selects a block on the basis of the condition related to that block. It means that if elif else statement has many conditions and corresponding blocks of statements. If a given condition is true, if… Read More »

Loading