-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdogage.rtf
More file actions
25 lines (24 loc) · 890 Bytes
/
dogage.rtf
File metadata and controls
25 lines (24 loc) · 890 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
{\rtf1\ansi\ansicpg1252\cocoartf2867
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\margl1440\margr1440\vieww11520\viewh8400\viewkind0
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
\f0\fs24 \cf0 #Named Constant\
nHUMAN_EQUIVALENT = 7.3\
\
#1. Input\
sAge = input("Input your dogs age: ")\
\
#2. Convert:\
fAge = float(sAge)\
\
# 3. Compute\
fHumanAge = fAge * nHUMAN_EQUIVALENT\
\
# 4. Output:\
\
# 4.1 Convert fHumanAge to a string with no formatting:\
print("The human age equivalent for your dog is: " + str(fHumanAge))\
# 4.2 Convert fHumanAge to a string with formatting and column that is 10 characters with 2 decimal points:\
print("The human age equivalent formatted for your dog is: " + format(fHumanAge,'10.2f'))}