__STYLES__

Compare Your Marital Status Against Statistics From Census Data

Tools used in this project
Compare Your Marital Status Against Statistics From Census Data

Project video

About this project

Intro

This project is called "Marriage" and checks the user's marital status against the Median Age At First Marriage for the same user State and sex, per the US Census Data.

What software does

  1. Ask the user for age, sex, state, marital status
  2. Validate user input
  3. Make an API request to Census Data API for Median Age At First Marriage, for the user State and sex
  4. Give the user the statistic of Median Age At First Marriage for the selected state and sex, and display a friendly comment that tell the user if he/she is early, late or in time depending on the user age and marital status
  5. Log the user stats in a CSV file, called stats.csv, with a timestamp

What features does the program have

  • Functions, Variables, Constants
  • Lists, Dictionaries
  • Conditionals
  • Exceptions
  • Libraries: sys, requests, csv, datetime, os.path
  • Unit Tests
  • File I/O: writing CSV file

New skills acquired

  • Working with the Census Data API
  • How to check if a file already exists, via os.path library
  • How to test system exit with pytest library
  • Use datetime.now() method from datetime library to make a timestamp
  • How to format a text file with Markdown syntax
Discussion and feedback(0 comments)
2000 characters remaining
Cookie SettingsWe use cookies to enhance your experience, analyze site traffic and deliver personalized content. Read our Privacy Policy.