Académique Documents
Professionnel Documents
Culture Documents
-+ - / * % **
#comment
String=”====”
String=print(input(‘===’))
String-string=”==”
Print(string.upper/lower())
New line-\n
Myname=”edcecd”
Age=32
Total=(myname+str(age))
Print(string.title())
Animal=[“ddd”,”dd”]
Print(animal[1].title())
Print(animal[-1].title())
Combine lists=
Msd=”dsfdeffef”
Print)msd+animal[1].title())
Or
Print(“efwffw”+” “+animals[1].title())
list[“aa”,”bbb”]
list.sort
list.sort(reverse=true)
Print(len(list))
Min,max,sum=listnum=[1,2,3,4]
Print(min(listnum))=1
Print(max(listnum)) = 4
Print(sum(listnum)) = 10
Making slicing list-we need to specific the last and first element [:]
List=[‘ccc’,’ccc’]
Coping list using slicing list-if we want to add new element to your slice list or edit it
List=[‘ddd’,’ddd,’ddd’]>cpy_list=list[:]>cpy_list.append()
Tuples-that imutable pythion object that like list but we can change that
Tup = ( , , )
If elif else
Elif ( ) :
Dictionary in python-collection similar to list the allow connect pieces of information so we can acess thes information inside
oure dictionaris and change information
dic={ “Toyota”:”camery”,”cylinder”:”v6” }
input-