[Tutor] Hmm...I should be able to figure this out...but... (original) (raw)
Dragonfirebane at aol.com Dragonfirebane at aol.com
Tue Jul 20 22:54:23 CEST 2004
- Previous message: [Tutor] Hmm...I should be able to figure this out...but...
- Next message: [Tutor] Re: algorithm?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
# Initialize Variables string = "" stringlength = 0
# Begin Program string = rawinput("Enter a string and I will display it backwards.\n") stringlength = len(string) for i in range (stringlength, 0, -1): print string [i - 1], print "\n" rawinput("\nPress the enter key to exit")
try (untested):
Initialize Variables
string = "" stringlength = 0 rstring = []
Begin Program
string = raw_input("Enter a string and I will display it backwards.\n") stringlength = len(string)
for i in range (stringlength, 0, -1): rstring.append(string[i - 1]) print ''.join(rstring),
print "\n"
raw_input("\nPress the enter key to exit")
-- "n thats the way the cookie crumbles"
America's Favorite Cookie
- Previous message: [Tutor] Hmm...I should be able to figure this out...but...
- Next message: [Tutor] Re: algorithm?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]