Python Identifiers:
Starts with A-Z,a-z or underscore
DON't start with digits
DON'T use reserved keywords
Mandarin is allowed in Python 3
Case sensitive ( name , Name are different variables)
DON'T contain special characters or space
-----------------------------------------------------------
type() or .__class__ , id()
Immutable : integer, float, string, tuple (new ids will be created when you assign the variable to a different value)
mutable : list , dictionary, set (no new ids)
----------------------------------------------------------------------
What's the output of print(True + False)?
----------------------------------------------------------------------
int() , float() , division versus floor division
---------------------------------------------
Ternary operator in Python (if.else, elif, and/or/not)
------------------------------------------------
For loop, range( starts , ends , step)
----------------------------------------------
For , While Loop
-----------------------------------------------
slicing with index ; str.replace() ; str.find() ; str.join() ; str.split()
------------------------------------------
String formatting
----------------------------------------------------
list.append() ; list.extend() (id remains the same)
list.insert() ; list.remove() ; list.pop() ; del list[n:m]
--------------------------------------------------------------------------
sorted V.S. sort()
sorted(list) list won't change string can be sorted as well
list.sort() list will change ; sort() can only be used on list
------------------------------------
Dictionary
Comments