forked from course-work/week1
stuff to do
This commit is contained in:
16
03-roman-numerals/README.md
Normal file
16
03-roman-numerals/README.md
Normal file
@ -0,0 +1,16 @@
|
||||
Arabic to Roman Numerals Challenge
|
||||
==================================
|
||||
|
||||
Did you know our numeral system - the symbols we use to represent numbers are called
|
||||
Arabic numerals? Fun fact, because now it gets serious. You're going to be translating Arabic to Italian.
|
||||
|
||||
Have the input form accept a number from the user. When the form is submitted, have the function to_roman take an integer as an argument and return a roman numerals string. For example:
|
||||
```
|
||||
60 >> LX
|
||||
78 >> LXXVIII
|
||||
99 >> XCIX
|
||||
3000 >>> MMM
|
||||
```
|
||||
Look up Roman Numerals to get a complete list and jog your memory on its ancient conventions. This is an easy challenge to code, but can be a difficult mental exercise. Don't overcomplicate it!
|
||||
|
||||
Add your own assert statements to the bottom to test your code.
|
BIN
03-roman-numerals/__pycache__/roman.cpython-34.pyc
Normal file
BIN
03-roman-numerals/__pycache__/roman.cpython-34.pyc
Normal file
Binary file not shown.
18
03-roman-numerals/roman.py
Normal file
18
03-roman-numerals/roman.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Use this function to get and return all the prime numbers below the input number
|
||||
|
||||
def to_roman(num):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
assert to_roman(11) == "XI", "11 should return XI"
|
||||
assert to_roman(60) == "LX", "60 should return LX"
|
||||
assert to_roman(78) == "LXXVIII", "78 should return LXXVIII"
|
||||
assert to_roman(4) == "IV", "4 should return IV"
|
||||
assert to_roman(99) == "XCIX", "99 should return XCIX"
|
||||
|
||||
# Add your own assert tests below
|
Reference in New Issue
Block a user