Skip to main content

Posts

Showing posts with the label The Crazy Programmer Python Declare Variable Without Value Python Declare Variable Without Value The Crazy Programmer

Python Declare Variable Without Value Gorakh Gupta The Crazy Programmer

We know that in many languages like C, C++, Java, when we want to use any variable then first we have to declare that variable and after that, we can use that variable in our program. The languages listed above are high-level languages that are compiled before it runs, but Python is a dynamically compiled language. In python, we don’t have to specify which type of variable we are going to use. Simply we have to write the name of a variable and we can use it as per our own like we can store an integer value or a string value in the same variable. So the question comes, is it possible to declare a variable without value in python? The answer is no, we cannot declare a variable without value in python. I will demonstrate an example to prove my point. Let us see a basic addition of 2 numbers program in Python. num1 = int ( input ( " Enter Number 1 : " ) ) num2 = int ( input( " Enter Number 2 : " ) ) print ( f " Sum is { num1 + num2 } " ) Output: PS C :