Wednesday, February 13, 2019

Numbers


  • Number data types are used to store the numerical values
  • Different numerical types in Python
               Integer numbers: Positive or Negative  whole numbes(EX: 1,10,-18)
               Floating point numbers: Real number with decimal points(EX: 10.9, 23.008)
               Complex numbers: Numbers are in the from of X+Yi , where i is the imaginary number






Python Data Types

Python provides some built-in data types as listed below


  • Numbers: Numerical values
  • String: Sequence of Unicode characters
  • Boolean: “Truthiness” || True or False
  • List: Ordered sequence of items
  • Tuple: Same as List, but they are immutable
  • Dictionary: Unordered collection of key-value pairs
  • Set: Unordered collection of unique items

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