Skip to content

Data Types and Use of Operators

surendrabisht edited this page Jul 11, 2020 · 6 revisions

Use of Type function() to know the type of variable.

In below example, list,dictionary and Tuples are the non-primitive types i.e. they are derived from primitive types.
All 3 of them, are collection of values.

Also, you can see a,b,c,...g here are the variables holding some value.
So, now you know how we assign values variable.

Variable naming

Also, can write multiple assignments in one a,b,c=2,"Surendra",3.4
or
a=b=c=4 i.e. all variables are assigned same value.

type of function


Points to discover on your own

There are lot of things that should be covered but explaining all those things in these wiki pages I will end up making a book. So, to keep it short do visit some of the points mentioned below and hence we can skip defining these and will be using these directly later on:

  • Camel casing vs Pascal Casing - Way to name variable, functions and classes.
  • Arithmetic (+,-,*,/ ,// ,% ,**), Comparison(>,<,>=,<=,==,!=), Assignment(=,+=,-=,etc), Logical( and ,or , not ), Membership( in, not in ) and Identity (is ,is not )
  • Indentation : Mandatory in python to indicate a block of code.
  • Operators Precedence [ BODMAS of programming language]
  • Data Type conversion Or Type casting
  • use of Escape Sequences in print() function: \t, \n, \r -- tab, newline, return
  • \ use to escape special characters

Example of use of operators:

Operators try

Clone this wiki locally