Hello Everyone
Description:
This is my first time doing a traversal loop from chapter 8 exercise 1, and now I know how to make letters print backwards.
Code:
a = [“b”,”a”, “n”, “a”, “n”, “a”, “s”]
for letters in reversed(a):
print letters
Screenshot:
Description:
This is chapter 10 exercise 3. This exercise was challenging trying to find out how exactly to write this code. I have figured it out and now it can run!
Code:
a = [i**1 for i in range(5)]
squares = [x**2 for x in range(5)]
print a
print squares
Screenshot:
No comments