Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Exercise 6.1 Write a while loop that starts at the last character in the string and works its
- way backwards to the first character in the string, printing each letter on a separate line, except
- backwards.
- fruit='banana'
- i=len(fruit)
- while i>0:
- print fruit[i-1],'\n'
- i=i-1
- Exercise 6.2 Given that fruit is a string, what does fruit[:] mean?
- fruit='banana'
- print fruit[:]
- Types the full string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement