Python Lists is much like flexible size arrays, declared in other languages like vector in C++, array list in Java, etc. Lists are heterogeneous, making… Read More
Tag Archives: python-basics
Let us see how to control the increment in for-loops in Python. We can do this by using the range() function. range() function range() allows… Read More
Prerequisite: Python For loops The for loop has a loop variable that controls the iteration. Not all the loops utilize the loop variable inside the… Read More
A variable defined inside a function block or a looping block loses its scope outside that block is called ad local variable to that block.… Read More
In simple terms, variables are names attached to particular objects in Python. To create a variable, you just need to assign a value and then… Read More
Generally, literals are a notation for representing a fixed value in source code. They can also be defined as raw values or data given in… Read More
In this post, We will see how to take integer input in Python. As we know that Python’s built-in input() function always returns a str(string)… Read More
Given a number. The task is to check whether the number is positive or negative or zero. Examples: Input: 5 Output: Positive Input: -5 Output:… Read More
Rounding a number means making the number simpler by keeping its value intact but closer to the next number. Below are the following points that will… Read More
A new version of Python is coming! Soon, we’ll be using it in our Python projects. As of 20/07/2020 Python 3.9 is in beta version(3.9.0b4)… Read More
Converting a float value to an int is done by Type conversion, which is an explicit method of converting an operand to a specific type.… Read More
Variable is a name for a location in memory. It can be used to hold a value and reference that stored value within a computer… Read More
Let us see how to convert a string object into a float object. We can do this by using these functions : float() decimal() Method… Read More
Context variable objects in Python is an interesting type of variable which returns the value of variable according to the context. It may have multiple… Read More
Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication and division. There are 7 arithmetic operators in Python : Addition Subtraction Multiplication… Read More