This repository contains Python cenceptual notes with syntax & examples. Helpful for quick revision and to use as a cheetsheet.
- Characteristics and advantages of python
- General programming paradigm
- Variable declaration
- How to declare variables and initialize variables(assign values)
- Python Identifiers
- Naming conventions for Python identifiers
- Python Data types
- Dealing with strings
File showing syntax and examples.
- Single string
- Multiple string
- String slicing
- Modify strings: lower(), upper(), strip()
- Split a string
- Join strings
- Check the presence of a character(s) in a string.
Find out what else we can do with strings
e.g:
% modulus operator, a%b gives the remainder of a/b
** power operator, a**3 means cube of a.
# or,
pow(a,3) means cube of a
// floor division operator. (Gives division results in integer and ignores the remainder)
x += 3 ---> means x = x+3
e.g: == Equal
!= Not equal
>> x is y # this return True if x and y are exactly same object.
a= ['q',3,43]
b= ['q',3,43]
c = b
print(a is b) # Returns False
print(c is b) # Returns True
# Another identity operator is: x is not y
if x in list:
print('True')
else:
print('False)
# Similarly another membership operator is: not in
Deals with binary bits.
AND - Binary AND operation
NOT - Binary NOT operation
- list, tuple, dict, set
- Basic differences.
- How to access elements from them.
- In which situation, which one to use!
- Taking multiplt inputs for different variables
- Taking mutiple inputs for the same variable.
- Optimized way to print multiple strings and variables together
- Short hand if
- Short hand if else
- For loop and else
- While loop and else
- For loop vs While loop
- Break vs Continue