-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstringsexercise3.py
More file actions
34 lines (24 loc) · 887 Bytes
/
stringsexercise3.py
File metadata and controls
34 lines (24 loc) · 887 Bytes
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
# medicine = 'Coughussin'
# dosage = 5
# duration = 4.5
# instructions = '{} - Take {} ML by mouth every {} hours'.format(medicine, dosage, duration)
# print(instructions)
# instructions = '{2} - Take {1} ML by mouth every {0} hours'.format(medicine, dosage, duration)
# print(instructions)
# instructions = '{medicine} - Take {dosage} ML by mouth every {duration} hours'.format(medicine = 'Sneezergen', dosage = 10, duration = 6)
# print(instructions)
# name = 'World'
# message = f'Hello, {name}.'
# print(message)
# count = 10
# value = 3.14
# message = f'Count to {count}. Multiply by {value}.'
# print(message)
# width = 5
# height = 10
# print(f'The perimeter is {(2 * width) + (2 * height)} and the area is {width * height}.')
value = 'hi'
print(f'.{value:<25}.')
print(f'.{value:>25}.')
print(f'.{value:^25}.')
print(f'.{value:-^25}.')