Complete the 2-3 Assignment

This commit is contained in:
Joe S 2021-01-20 00:20:26 -05:00
parent e08e312789
commit 6d9c78c801
9 changed files with 58 additions and 0 deletions

3
2/2-3/.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

11
2/2-3/.idea/2-3.iml Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="pytest" />
</component>
</module>

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

4
2/2-3/.idea/misc.xml Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
</project>

8
2/2-3/.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/2-3.iml" filepath="$PROJECT_DIR$/.idea/2-3.iml" />
</modules>
</component>
</project>

6
2/2-3/.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

Binary file not shown.

Binary file not shown.

20
2/2-3/main.py Normal file
View File

@ -0,0 +1,20 @@
import datetime
def prompt_user():
name = input('What is your name? ')
try:
age = int(input('How old are you? '))
except ValueError:
return 'Age must be a number.'
return 'Hello {0}! You were born in {1}.'.format(name, get_year() - age)
def get_year():
now = datetime.datetime.now()
return now.year
if __name__ == '__main__':
print(prompt_user())