In: Computer Science
Write a program that prints out the ASCII number value of a statement or phrase.
The user should be prompted to enter a string of text. Then, using a loop, print the ASCII values of each letter in the entered text.
Take a screenshot of both your code and your properly executed code after you have run it. Submit the screenshots here along with your .txt file.
Hint:
The 'ord' and 'chr' functions convert to and from ASCII within python.
Here is the solution to above problem in Python. PLEASE GIVE A THUMBS UP!!!
Read the code comments for more information and refer to code screenshot for more informaiton
Python code
#word input from user using raw_input
word= raw_input("Enter a pharse or word:")
#printing space seperated ascii value of each character
print("ASCII VALUES ARE")
#iterating word string character by character
for char in word:
#ord converts char to integer and str converts interger to
string
#so that we can print it using print function
print(str(ord(char)) + " "),
Screenshot of code

Screenshot of output
