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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:14:01+00:00 2026-06-03T13:14:01+00:00

I have a list that looks like this: foo = [z, q, t, a,

  • 0

I have a list that looks like this:

foo = ["z", "q", "t", "a", "p", "m", "n", "b", "c", "w", "l", "d", "f", "h",
       "y", "e", "j", "k", "g", "i", "o", "r", "u", "s", "v", "x"]

and i have another list that looks like this:

bar = ["h", "e", "l", "l", "o", "m", "y", "n", "a", "m", "e", "i", "s", "r",
       "e", "a", "l", "l", "y", "l", "o", "n", "g", "a", "n", "d"]

what i want to do is use the first element of foo, and replace the first element of bar with it, and so that the first element of foo is now always worth "h", so if "h" ever comes up in bar again, "z" (the first element of foo) is automatically put in. the second element of foo is then subbed in for the second element of bar (unless it’s "h") and then second element then becomes "e", and so on until the entirety or bar has been encrypted using foo for the letters. and then print the new bar but with the letters changed from the encrypton process.

  • 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-03T13:14:05+00:00Added an answer on June 3, 2026 at 1:14 pm

    It’s very simple, actually:

    new_string = ''
    
    for every letter in your string:
      new_string = new_string + bar[index of the "letter" in foo]
    

    I’ll leave it to you to figure out the appropriate Python functions, as you’d benefit from learning how to do it by yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of dictionaries that looks like this: [{'id':1,'name':'Foo'},{'id':2,'name':'Bar'}] I'd like to
I have a list of lists that looks like this: x[[state]][[year]] . Each element
I have code that looks something like this: self.ui.foo.setEnabled(False) self.ui.bar.setEnabled(False) self.ui.item.setEnabled(False) self.ui.item2.setEnabled(False) self.ui.item3.setEnabled(False) And
I have code that looks something like this: self.ui.foo = False self.ui.bar = False
I have a class that looks like this: typedef std::list<char*> PtrList; class Foo {
i have a list of lists that looks like this: dupe = [['95d1543adea47e88923c3d4ad56e9f65c2b40c76', 'ron\\c',
I have a binary tree in unordered list that looks like this: <ul> <li>1
I have a file that contain list of numbers that looks like this: 10^-92
I have code that looks like this: template<class T> class list { public: class
I have a query that looks like this: it takes a list of IDs

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.