I am extremely new to programming so it's taking a lot to re-wire. my brain to think like a computer programmer.
I need to create a script in Python using a while loop that does this:
zebra arbez ebraz zarbe braze ezarb razeb bezar azebr rbeza
Keep in mind that the script should be able to do this with any word. For example, right now a = 'zebra'. If a = 'cat' the the script should look like:
cat tac atc cta tca cat
I've figured out how to do it with a for loop...just can't figure out exactly how to implement it with a while loop.
My for loop:
a = 'zebra'
for i in range(len(a)):
print a[i:] + a[:i], (a[i:] + a[:i])[::-1]
If anyone could help me out, or give me hints...I'd really appreciate it! thanks!