python Flashcards
python 2 vs python 3
python plrogramming language was created by
datatypes in python
python has several datatypes available to us they are:
1. int=integer
2. float=float
3. bool= boolean
4.str= strings
5. list= list
6. tuples= tuples
7.set=sets
8. dict=dictionaries
data types are the values in python.
- int represents all the numbers.
-strings will represent all the letters
they area also called as findamental data types.
-float stands for floating point.floating point number is a number with deimal point
classes in pyhton
beyond data types we can create something called classes on our own
specialized data types
specialized data types are special modules and packages that we can use from libraries .
these are not built in python . its like extension to the python package
none
none means nothing, its like zero in maths . its the absence of the values
addition ,subtraction,division, multiplication, division, modulo ,power
addition=+
subtraction=-
multiplication=*
divisoi\
variables
variables store information that can be used in out programs we can hold user inputs like values , variables can sometimes be called as names . assining a value is also known as binding.underscore in python signifies a private variable
expressions and statements
an entire line of code that performs certain action is called as statement and the code which performs action is called as expression.
augmented assignment operator
assignmetn operator is used to assign value to the variable.
strings
strings is simply a piece of text written in cuotation mark
string cocatination
string cocatination is joiing of two strings .like : print (“hello” + “abdan”) etc.
type conversions
type conversions directly converts one data type to another which is useful day to day and competitive programming.
escape sequence
escape sequence is used to insert al character that are illegal in string we use escape character with /
formatted string
formatted string allows you to create dynamic strings by combing variables and values in the article .
it is denoted by f.
ex: print (f ‘hi’ {name}. you are {age} years old’)
etc.
string indexes
strings can be accessed , and using square brackets we can access different parts of the string. the idea of [start: stop :stepover] is called as slicing .