Search Bar

Friday 26 May 2023

"Python Programming" Tut#09 | "If-else", "elif" statements

Python Tutorial 09

If-else statement

In Python, the if-else statement is used to perform different actions based on a certain condition. It allows you to execute a block of code if a condition is true, and another block of code if the condition is false.

The general syntax of the if-else statement in Python is as follows:

Sunday 21 May 2023

Python Programming Tut#08 | List, Tuple, Dictionary

Python Tutorial 08

Lists in Python

In Python, a list is a built-in data structure that allows you to store a collection of items. It is an ordered and mutable (changeable) sequence. Each item in a list is called an element and can be of any data type, including numbers, strings, or even other lists. Lists are created using square brackets [ ] and commas , to separate the elements.

Here's an example that demonstrates various operations with lists:

Python Programming Tutorial 08 | List, Tuple, Dictionary
Python Programming Tutorial 08 | List, Tuple, Dictionary

Saturday 20 May 2023

Python Proramming Tut#07 | Python Operators

Python Tutorial 07

Python Operators

In Python, operators are special symbols or characters that are used to perform operations on variables, values, or expressions. Python provides a wide range of operators that serve different purposes. Here are the main categories of operators in Python:

Arithmetic Operators: 

Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication, division, modulus, and exponentiation.

Addition: '+'

Subtraction: '-'

Multiplication: '*'

Division: '/'

Modulus (remainder): '%'

Exponentiation: '**'

Floor Division (quotient): '//'

Saturday 6 May 2023

Python Programming Tut#06|Data Types

Python Tutorial 06

Data Types in Python

Python is a dynamically-typed programming language, which means that you do not need to explicitly declare the data type of a variable before using it. The data type of a variable is determined automatically based on the value assigned to it.

However, Python has several built-in data types that you can use, including:

Numbers: int (integer), float (floating-point number), and complex (complex number).

Strings: a sequence of characters enclosed in quotation marks.

Boolean: a data type that can have one of two values: True or False.

Lists: an ordered collection of items, which can be of any data type.

Tuples: similar to lists, but immutable (cannot be changed).

Sets: an unordered collection of unique items.

Dictionaries: a collection of key-value pairs, where each key is associated with a value.

Here's an example of how to create variables of different data types in Python:

Sunday 30 April 2023

Python Programming Tut#05|Variables in Python

 Python Tutorial 05

Variables in Python

In Python, a variable is a container that stores a value, which can be a number, a string, a boolean, lists, tuples, dictionaries or any other data type. You can assign a value to a variable using the equal sign (=).

For example:

x = "Hello, World!"

In this example, x is the name of the variable, and "Hello, World!" is the value that it stores.