What is Variable? A variable is nothing but a reserved memory location to store values. In other words a variable in a program gives data to the computer to work on. Every value in Python has a datatype. Different data types in Python are Numbers, List, Tuple, Strings, Dictionary, etc. Variables can be declared by any name or even alphabets like a, aa, abc etc. In this tutorial we will learn, How to declare and use a variable Re-declare a Variable Concatenate Variables Local & Global Variables Delete a variable How to declare and use a variable Let see an example. We will declare variable "a" and print it. a=100 print a The output of variable should be "100" Re-declare a Variable You can re-declare the variable even after you have declared it once. Here we have variable initialized to f=0. Later, we re-assign the variable f to value "guru99" Concatenate Variables Let's see whether you can concatenate di...
Comments
Post a Comment