-
Notifications
You must be signed in to change notification settings - Fork 3
Data Types and Use of Operators
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.
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.
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
Keep Learning. Never Settle! 😊
- Home
- 1.Introduction To Python
- 2. DataTypes
- 3. Strings and Slicing of collection
- 4.If else & Loops
- 5. Break, continue, pass
- 6. Functions
- 7. Modules
- 8. Clarifying basics
- 9. File Handling
- 10. Exception Handling
- 11. Dig into Collections
- 12. Iterators, Generators and list comprehension
- 13. lambdas , map, filter and other concepts
- 14. args, kwargs an default parameters
- 15. Functional Programming
- 16. OOPs