Professional Documents
Culture Documents
Tugas Pemrograman Python (13-11-2019)
Tugas Pemrograman Python (13-11-2019)
Tugas Pemrograman Python (13-11-2019)
print("Hello " + name + "! your are " + age + " years old !")
# Creating a List
print(friends)
# List functions
print(friends)
friends.sort()
lucky_number.sort()
lucky_number.reverse()
print(friends)
print(lucky_number)
# Tuple basically same as list, tuple used for store data that could not be changed
coordinate = [4, 5]
print (coordinate)
# Definition of function
print("Hello User")
# execution of function
say_hi()
# execution of function
say_hi("John")
def say_hi (name, age) : # function with parameters name and age
# execution of function
say_hi("John", 35)
# For example
def cube(num) :
num*num*num
cube(3)
def cube(num) :
return num*num*num
print(cube(3)) # return to 27
print(cube(4))
result = cube(4)
print(result)