Start Python in interactive mode. At the >>> prompt enter the statement below. We are going to
Question:
Start Python in interactive mode. At the >>> prompt enter the statement below. We are going to provide an example of what we are going to do for Python interactive mode
print("This is my first homework assignment. My name is Hector Walls")
2) Make a variable named myString. Put in a statement in the Python interpreter to assign "My name is" to this variable.
Next, make a variable named myName. Put in a statement in the Python interpreter to assign your name to this variable.
Next, make a variable named singleSpace. Put in a statement in the Python interpreter to assign a blank space to this variable.
Last, type a single statement in the Python interpreter to print a message like "My name is Chris". Do this using only the print function and the three variables myString singleSpace, and myName?
Give the required statements and screenshots of the results in Idle.
3) Convert each of the characters of your name into their ASCII values.
See the example1.png screenshot showing the use of the 'ord' command to convert individual letters to ASCII.
Make sure it has all of the letters of your name. Take a screenshot similar to the example.
Start Python in interactive mode. At the >>> prompt enter the required statements to convert the letters of your name to ASCII.
4) Convert the ASCII values back into letters using the 'chr' command. See example2. Like the previous exercise, take a screenshot of your results.
5) Check your values against the ASCII chart. How would your results have differed if you changed the case of your letters? In other words, are the letters in 'Chris' the same ASCII values as 'CHRIS'? Explain your answer clearly. This is more than yes or no.
Financial Accounting and Reporting a Global Perspective
ISBN: 978-1408076866
4th edition
Authors: Michel Lebas, Herve Stolowy, Yuan Ding