0% found this document useful (0 votes)
2 views1 page

Python Word Reversal Example

The document contains a code snippet that demonstrates how to reverse a list of words in Python. It initializes a list of words and uses a for loop to print them in reverse order. Additionally, there are some formatting and syntax errors present in the code.

Uploaded by

yousefkakar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Python Word Reversal Example

The document contains a code snippet that demonstrates how to reverse a list of words in Python. It initializes a list of words and uses a for loop to print them in reverse order. Additionally, there are some formatting and syntax errors present in the code.

Uploaded by

yousefkakar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Indexes

1 2 3 4

a b c d

-4 -3 -2 -1

words = [“One of”, “you”, “is blue”]

Print(“\nMy original words:”, words}

input(“print any key to continue”)

print(“\nMy words backward: \n”)

for i in range (len(words) -1, -1, -1): # starts at -1, ends at -1, steps by -1

print (words [i])

You might also like