Implement a number parser. The function should take a string representation of a number and a base and convert the string into a Python integer. Note: in all deliverables, hard-coded components may help you pass tests, but they will receive very few points. For example, the character ' 0 ' always has the value 0 , but we will not look favorably on code which says something like if character ==0 ' : value =0. Your code should infer the value of the character ' 0 ' based on its position in the string base2, etc..
Implement a number parser. The function should take a string representation of a number and a base and convert the string into a Python integer. Note: in all deliverables, hard-coded components may help you pass tests, but they will receive very few points. For example, the character ' 0 ' always has the value 0 , but we will not look favorably on code which says something like if character ==0 ' : value =0. Your code should infer the value of the character ' 0 ' based on its position in the string base2, etc..