Python is a Dynamically typed programming language.What are the differences between statically typed and dynamically typed languages?
Category: Basic Concepts
let’s discuss basic concepts in python like variables, data-types, operators, looping, importing, file-handling, object-oriented etc …
Set up Python virtual environment using Anaconda
While working with python, we usually face the problem of setting up the virtual environment. In this blog I have covered the steps of creating virtual environment in python. Anaconda : Anaconda is an open source software that contains Jupyter, spyder idle etc that are used for large data processing, data analytics, heavy scientific computing. […]
Python – Set
Set in Python is an unordered and non-indexed collection of elements that are non-duplicate. It is a Mutable data-type. Creating a Set: a) Using a { }: Set can be created using curly brackets, serparated by comma. Output: {‘d’, ‘b’, ‘c’, ‘e’, ‘a’} b) Using a set() function: Set can be created using set() built-in […]
Python – Dictionary
In Python, Dictionary is an unordered, indexed collection of data values used to store data in the form of keys and values. Keys must be unique whereas values can be repeated. Only immutable data types like string, tuple, int, etc. can be used as keys. Creating a Dictionary: a) Using a { }: Dictionary can […]
Python – Tuples
This article covers about tuples in python. Tuples can be a collection of homogeneous or heterogeneous items. It can be seen as similar to list but the major difference is that list is mutable unlike tuple which is immutable and list uses square brackets but in tuple we use parentheses. Creating a Tuple: a) Empty […]
Python – frozenset() function
In this article, we will be discussing frozenset() which is an inbuilt function provided by Python language. frozenset() function: The task of this function is to freeze the iterable objects provided and make them unchangeable So that, no changes take place. Also, frozenset() is somehow similar to set(). However, it differs only in making the […]
Python – Strings
In this article, we’ll be covering about Strings in Python. Strings in Python are a sequence of characters enclosed in single-quotes, double-quotes or sometimes in triple-quotes. Output: <class ‘str’> Accessing characters in String: We can access characters in the string by using an index number in the square brackets. Output: H o Iterating through String: […]
Data Types in Python
As we know Python is an object-oriented programming language so everything is considered as an object in Python, data types are actually classes and variables are instance (object) of these classes. Depending upon the properties, there are manly 7 basic data types: 1. Numbers: This datatype mainly has a numerical value. Integer Float Complex Output: […]
Operators in Python
Operators are used to performing operations on values. Operators in Python are divided into the following categories : Arithmetic operators Assignment operators Logical operators Comparison operators Identity operators Membership operators Bitwise operators Arithmetic operators: These operators are used to perform mathematical operations (addition, subtraction, multiplication, division) on numerical values. “+”: This operator is used to […]
Python Lists
The List is a collection of heterogeneous data type that is ordered and changeable i.e. mutable. It allows duplicate members. Creation of list: Using square brackets: Output: [] [‘apple’, ‘orange’, ‘kiwi’] Using list() built-in function: Output: [] [‘a’, ‘p’, ‘p’, ‘l’, ‘e’] Access elements of the list: We can access any element from the list […]