forked from ak4shp/learning-python-month-1-akash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10-function.py
More file actions
41 lines (33 loc) · 1.4 KB
/
10-function.py
File metadata and controls
41 lines (33 loc) · 1.4 KB
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
'''EXCERCISSE 1: EMOJI CONVERTER'''
# def greet_me(name, message):
# words = message.split(" ") # Converts input message into list
# emojis = { # Dictionary
# ":)" : "😃",
# ":(" : "🙁",
# ":o" : "😮",
# ":|" : "😑"}
# output = "" # Can be appended
# for word in words:
# output += emojis.get(word, word) + " " # Appending using get() method
# return f"Dear {name}. Your message is : " + output
# welcome = '''!!! Welcome to the emoji converter !!! You can choose following symbols ->
# ":)"
# ":("
# ":o"
# ":|"
# '''
# print(welcome)
# first_name = input("Enter your first name: ")
# value = input(f"hey {first_name} what do you want to say: ")
# print(greet_me(first_name, value))
'''EXCERCISE 2: WEIGHT CONVERTER'''
# def weight_converter(weight, unit):
# if unit.lower() == 'l': # convert unit to lower case
# weight = current_weight * 0.45 # lbs to kg
# print(f"You are {weight} kilos")
# elif unit.lower() == 'k':
# weight = current_weight / 0.45 # kg to lbs
# print(f"You are {weight} pounds") # Print here
# current_weight = float(input("Weight: "))
# unit = input("(L)bs or (K)g: ")
# weight_converter(current_weight, unit) # Can not print just call as kilos and pounds differs depending on input.