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 8590797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:22:34+00:00 2026-06-11T23:22:34+00:00

So this new problem I have come to is this. I have a two

  • 0

So this new problem I have come to is this. I have a two lists with five items each.

listone = ['water', 'wind', 'earth', 'fire', 'ice']
listtwo = ['one', 'two', 'three', 'four', 'five']

What I want to do is print the first, second, third and fifth items from each of these lists in a string:

print("the number is %s the element is %s" % (listtwo, listone)

But they need to print in a new row each time so that the text is run for each of the elements in the two lists:

the number is one the element is water
the number is two the element is wind
the number is three the element is earth
the number is five the element is five

I have no idea how to do this. I tried using list split but since its the fourth item out of five I can’t figure out how to skip it. Also I use this to list the string in a new row:

for x in listone and listtwo:
print("the number is {0} the element is {0}".format(x)  

But I don’t know how to use this with two lists or if it even can be used with two lists.

Please help 🙁

EDIT:

Also I don’t know what the elements of the scripts are so I can only use their number in the list. So I need to get rid of [4] in both lists.

  • 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-06-11T23:22:35+00:00Added an answer on June 11, 2026 at 11:22 pm
    for (i, (x1, x2)) in enumerate(zip(listone,listtwo)):
        if i != 3:
            print "The number is {0} the element is {1}".format(x1, x2)
    

    Explanation

    • the zip(listone,listtwo) gives you a list of tuples (listone[0],listtwo[0]), (listone[1],listtwo[1])...
    • the enumerate(listone) gives you a list of tuples (0, listone[0]), (1, listone[1]), ...]

      (you guessed it, it’s another, more efficient way to do zip(range(len(listone)),listone)

    • By combining the two, you get a list of the elements you want along their indices
    • Because your first element has index 0 and that you don’t want the fourth element, just check that the index is not 3
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem with WPF - I'm quiet new in this smart technology. So
I am new to c# and I have this problem: I have here a
I have problem. This is my code: var method = new DynamicMethod(dummy, null, Type.EmptyTypes);
I have this problem: I want to generate a new source code file from
I'm quite new to hibernate and have stumbled on this problem, which I can't
I have a little problem. This is my code: stackPanelShapesContainer = new StackPanel(); InitializeStackPanle();
Hi Guys new to this site but a big fan. Right the problem. It's
I'm quite new to this, but i cannot figure out the problem. In twitter
being new to WPF this is a complex problem for me. What i want
I'm having this problem on a new cruisecontrol.net install running on Windows Server 2003

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.