Python Loops

According to Google – “In computer programming, a loop is a sequence of instructions that is continuously repeated until a certain condition is reached.” Now try to understand this. Why Loops are so important? Consider a situation- What if I ask you to print “Hello World” 4 times in Python. […]

Python Loops Read More »

Python Dictionaries

In Python, a dictionary is a collection type that is used to store data in the form of key-value pairs. A dictionary is ordered, changeable, and does not allow duplicate values. The factor that makes a dictionary different from lists, tuples or sets is that in a dictionary each value

Python Dictionaries Read More »

Python sets

Just like the lists or tuples, a set in python is also one of the collection types. A set is unordered, unindexed, and unchangeable. It is written using curly braces. Example of a set: cities = {'Delhi', 'Mumbai', 'Hyderabad', 'Bhopal'} print(cities) Output: {‘Delhi’, ‘Mumbai’, ‘Hyderabad’, ‘Bhopal’} Set items are unordered

Python sets Read More »

Python tuples

Like lists, tuples are also used to store multiple values in a single variable. It is a collection that is ordered and unchangeable. Unlike lists, Tuples are written with round brackets. Example sample_tuple = ("east", "west", "north", "south") print(sample_tuple) Output: (“east”, “west”, “north”, “south”) Tuples are ordered Tuples are ordered,

Python tuples Read More »

Python lists

A list in Python is a datatype that is used to store multiple values. A list can be formed by assigning different values inside square brackets and separated by commas. Example mylist = ["India", "France", "Australia", "Nepal"] print(mylist) Output: [“India”, “France”, “Australia”, “Nepal”] Items in list are ordered, indexed, and

Python lists Read More »

PHP Constants

In PHP, a constant is like a variable except for one fact its value cannot be changed once it has been created. A valid constant name can be started with a letter or an underscore(_). There is no need to put the dollar sign($), as we do with a variable.

PHP Constants Read More »

Operators in C

Operators in C are used to perform some operations on variables and constant values. See the example below #include <stdio.h> int main(){ int a = 4, b = 5, c; c = a + b; return 0; } In the above example, we are using the addition operator(+) to add

Operators in C Read More »