Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3791310
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:27:00+00:00 2026-05-19T12:27:00+00:00

I am extremely new to programming so it’s taking a lot to re-wire. my

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T12:27:01+00:00Added an answer on May 19, 2026 at 12:27 pm

    Here is some code that will work for any sized word, using a While loop:

    word = "alpha"
    index = 0
    
    while (index < len(word)):
        print word + "   " + word[::-1]
        word = word[1:] + word[0]
        index += 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm extremely new to rational tools. I have a script recorded and its ready
I am extremely new to socket programming and I am implementaing a file server
I am extremely new to python, having started to learn it less than a
I'm having an extremely weird problem with a PHP script of mine. I'm uploading
I am fairly new to Objective C and iOS programming but am constantly trying
I'm trying to polish my web programming skills with the unobtrusive yet extremely helpful
This seems like an extremely easy problem but alas I cannot figure it out
I'm extremely new to Android and just trying to get my head around these
I'm extremely new to mvc and webtest so please bear wtih me here. I
I am extremely new to the web-development scene, but I was wondering: Does anybody

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.