PY
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
# It is the information about products.
products = {
'Smartphone' : 199.99,
'Laptop': 799,
'Soundbar': 49.99,
'Keyboard': 9.99,
'Mouse': 2.99,
}
# You ask for an input from user with below code, but to make this program works I hardcoded it.
# user_input = input()
user_input = 'Smartphone'
# It formats the output with variables
# It is what SoloLearn teachs You
print('The price for ' + user_input + ' is ' + str(products.get(user_input)) + '.')
print() # an empty line
# it is the preferred way to format the output string.
# SoloLearn don't teach you this. You have to find other resources and learn from them.
print(f'The price for {user_input} is {products.get(user_input)}.')
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run