You are on page 1of 2

Mathematic functions

Pow(2,3)

Abs(no) -5  5

Max( 4, 6) which number is higher

Min (4,3 )

Round (3.7) ==4

From math import*

Floor(3.7) ==3

Ceeling (3.1) ==4

Sqrt(36)=6

Get input from user

Name = Input (“enter your name”)

List

Friends = [“yol”, “sdada”, “dsadsa”, 2, false]

Print (friends[0] )==yol

Print(friends[-1]== false (start dari belakang)

Print(friends[1:3]) == index 1 till 3

Modified

Friends.extend(can be variable )

Friends.append(“yol”) =always add item at the end of the list

Friends.insert (1,”yol”)== add in the middle

Friends.remove(“yol”)=- yol out of the list

Friends.clear()== remove all from the list

Friends.pop() == last element out kanan sekali

Friends.index(“yol”)= yolk at index 1. But print out keluar nombor

Friends.count(“yol”)= kira berapa ada but print out number

Friends.sort()==alphabetical order/ascending order

Luckynumbers.reverse()=reverse order

Friends2=friends.copy()=literally copy
Tupples

Coordinates = (2,3) cannot be modified

List

Coordinates = [2,3] can be modified

Functions

Def sayhi ()

Print (“hi”)

Sayhi()

What to Do When You Miss a Call From a Recruiter

You might also like