AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Let's see the problem statement and implementation of the solution. It is a popular problem was asked by the tech giant Amazon, Facebook in the interview. In this tutorial, we will write the Python program to convert the Roman numbers into the integer. Next → ← prev Convert Roman Number to Decimal (Integer) | Write Python Program to Convert Roman to Integer You can follow any responses to this entry through the RSS 2.0 feed.īoth comments and pings are currently closed.Python Tutorial Python Features Python History Python Applications Python Install Python Example Python Variables Python Data Types Python Keywords Python Literals Python Operators Python Comments Python If else Python Loops Python For Loop Python While Loop Python Break Python Continue Python Pass Python Strings Python Lists Python Tuples Python List Vs Tuple Python Sets Python Dictionary Python Functions Python Built-in Functions Python Lambda Functions Python Files I/O Python Modules Python Exceptions Python Date Python Regex Python Sending Email Read CSV File Write CSV File Read Excel File Write Excel File Python Assert Python List Comprehension Python Collection Module Python Math Module Python OS Module Python Random Module Python Statistics Module Python Sys Module Python IDEs Python Arrays Command Line Arguments Python Magic Method Python Stack & Queue PySpark MLlib Python Decorator Python Generators Web Scraping Using Python Python JSON Python Itertools Python Multiprocessing How to Calculate Distance between Two Points using GEOPY Gmail API in Python How to Plot the Google Map using folium package in Python Grid Search in Python Python High Order Function nsetools in Python Python program to find the nth Fibonacci Number Python OpenCV object detection Python SimpleImputer module Second Largest Number in Python This entry was posted on Sunday, November 2nd, 2014 at 2:44 am and is filed under kids. But, remember it was written as a quick homework checker by a ten-year old… so it’s not going to be the most robust or comprehensive solution for handling roman numerals you’ve ever seen! □įor what it’s worth, this is the script we came up with. But even better, found an excuse to turn it into a Code Club-style afternoon and get her to play with some Python. So I got her to find for herself that she’d gone wrong and what she needed to do to fix it. And looking at them again, having gone through explaining how to do it a bunch of times, she instantly saw where she’d gone wrong with her homework, and set about fixing it. It came up with different answers to what she’d written in her homework book for a lot of the questions. She used our program to check her homework. It seemed to work! (Good enough for the sorts of problems in her homework, at any rate). But otherwise, it was pair programming to turn her pseudocode into a Python program. I wrote a few helper functions to give her friendly, readable function names for some of the simple array handling she’s not familiar with. So together we turned her instructions into a Python script. With each set of instructions she came up with, I gave her an edge case that would break it and she had another go.Īfter she’d come up with a set of steps that she was happy with, I reminded her what she’d done in Code Club, that programming was just giving a set of step by step instructions to a computer. Once she sounded like she’d gotten a better idea of it, I got her to try and describe how to do it as a set of written step by step instructions. Having to explain it to someone else often helps to make it clearer to yourself. I decided to try something similar.įirst, I got her to try and explain how to convert roman numerals to her sister and me. I’m a big fan of rubber duck problem solving, but she hadn’t spotted that she’d gone wrong. She had missed the subtraction you’re supposed to do when a large value follows a smaller value. I could see that she’d gotten a lot of them wrong. Grace had some maths homework to do this weekend, converting a bunch of roman numerals into normal numbers.īeing an interfering sort of parent, I got her to show me what she’d done when she finished. Or… how I managed to make some of Grace’s maths homework into another Code Club session
0 Comments
Read More
Leave a Reply. |