-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_to_know_functions.py
41 lines (36 loc) · 1.35 KB
/
get_to_know_functions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# a basic function that has 0 parameters which prints my queen's name
# def hello():
# print("hello mandi!")
# hello()
# a function with 1 parameter
# def hello(name):
# print("hello " + name)
# print("i luv u soo damn much!")
#
# hello("mandi")
# a function with 2 parameters
# def hello(first_name, middle_name):
# print("hello "+ first_name + " " + middle_name)
# print("i luv u more than anything in this universe!")
# print("thank you for being a part of my life.......")
# hello("mandinee", "abhisheka")
# a function with 3 parameters with different data types
# def hello(first_name, middle_name, days_ago):
# print("hello " + first_name + " " + middle_name)
# print("i luv u more than anything in this universe!")
# print("thank you for being a part of my life.......")
# print("you came to my life " + str(days_ago) + " days ago")
# hello("mandinee", "abhisheka", 97)
# functions with return statement
# def multiply(first_num,second_num):
# result = first_num * second_num
# return result
# print(multiply(6,6)) # though it returns the "result" but we cannot see it, so we need to print it to the console
# variable scope
# name = "abhisheka" # global variable
# def display_name():
# name = "mandinee" # local variable
# print(name)
#
# display_name()
# print(name)