Walk Through

Time for code yet?

ALGORITHM

Another Quick Stroll

Code

left_char = roman[i] right_char = roman[i+1] left_value = convert_character(left_char) right_value = convert_character(right_char) if left_value < right_value: left_value = - left_value total += left_value
`def convert_character(roman_char): conversion_map = { 'M':1000, 'D':500, 'C':100, 'L':50, 'X':10, 'V':5, 'I':1, } return conversion_map.get(roman_char, 0)`

Summary

--

--

--

Learn to Code. Get a Job. Start Here! Learn more at www.codefellows.org

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Odoo 12: New Features and Functionality

451PCBcom (PCB) whitepaper v2.1 released.

How to Get an Inactive User’s GitHub Username

Kubernetes: How Industries are using to solve their use cases?

The only guide you need for a static website in Azure — Part 3 Automate using Azure DevOps…

Building a Login Screen Layout in Flutter

Are you getting the most value out of your digitalization project?

Under the Hood of DevRel: Amazon’s Adam FitzGerald

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Code Fellows

Code Fellows

Learn to Code. Get a Job. Start Here! Learn more at www.codefellows.org

More from Medium

How software developers should approach & solve a coding problem

Read this if you’re planning on getting your first job in Software Development

How To Ace Your Coding Assessments

Day 30 Errors, Exceptions and Saving JSON Data 100 days of code