In the second lab I will be explaining number conversion. I may mention it in the other labs, but I will definitely discuss it in tutorial 2. You will need to learn how to get input from the user. Hints given by Professor Jacobson are for you to look up python raw_input and how to convert a number to an integer. Look up also how to use the math function pow in python, as this will help in your final solution. Printing is another thing to be weary of. For example, these two sets of two lines of code are different in their result:
print “hello”,
print “good bye”
and
print “hello”
print “good bye”
The former will print them both on the same line, while the latter will print them both on separate lines. Keep this in mind when converting bases and printing out a result.
You will need to know about the following concepts in python to do this assignment(at least these are concepts I required to do the assignment):
-for loops or while loops
-getting input from a user and casting it to an integer (hint: to cast any variable to an integer, simply do the following yourVariable = int(variableToConvert)
-knowing the pow function
-printing out values

Add A Comment