Tuesday, February 12, 2019

Variable Assignment Statements and Naming Rules & Conventions

What is a Variable?

  • Variables are used to store information to be referenced and manipulated in a computer program
  • We use "=" symbol to assign a value to a variable
            var1 = value
Variable Name Rules
  • The variable name must start with [a-z][A-Z]or _(underscore) followed with any number of characters from [a-z][A-Z][0-9] or _(underscore)
  • Variable names are case sensitive("SACHIN" is not same as "sachin")
  • There are some python keywords reserved for a special purpose . We should avoid using those keywords as a variable name.(keyword-list)
Dynamic type binding

  • Unlike other strongly-typed programming languages like C,C++ JAVA etc where  we have to define variable along with data type they are going to hold, is not required in Python








No comments:

Post a Comment