Showing posts with label slice. Show all posts
Showing posts with label slice. Show all posts
Tuesday, February 10, 2015
Saturday, January 17, 2015
Reversing a String
The simple program below demonstrates reversing a user inputted string.
Basic outline:
Basic outline:
- User inputs a string
- An empty reverse string variable is created
- A while loop is utilized to create the reverse string by starting at the end of the user inputted string, using indexing.
- The reverse message is printed.
Tuesday, January 13, 2015
Using Tuples (slicing, concatenate)
The following program demonstrates the use of tuples. See the program below for slicing a tuple and concatenating a tuple.
Subscribe to:
Posts (Atom)