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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:09:13+00:00 2026-06-18T05:09:13+00:00

I want to create a simple cipher in which it uses Phone numbers in

  • 0

I want to create a simple cipher in which it uses Phone numbers in place for the letters (input given).

Here is my code below showing what i’m trying to do with just a sample text, but I get an error code of key error: ‘L’

def main():

    phoneCipher = {'id' : A, 'val': 2},{'id' : B, 'val': 22},{'id' : C, 'val': 222},{'id' : D, 'val': 3},{'id' : E, 'val': 33},{'id' : F, 'val': 333},{'id' : G, 'val': 4},{'id' : H, 'val': 44},{'id' : I, 'val': 444},{'id' : J, 'val': 5},{'id' : K, 'val': 55},{'id' : L, 'val': 555},{'id' : M, 'val': 6},{'id' : N, 'val': 66},{'id' : O, 'val': 666},{'id' : P, 'val': 7},{'id' : Q, 'val': 77},{'id' : R, 'val': 777},{'id' : S, 'val': 7777},{'id' : T, 'val': 8},{'id' : U, 'val': 88},{'id' : V, 'val': 888},{'id' : W, 'val': 9},{'id' : X, 'val': 99},{'id' : Y, 'val': 999},{'id' : Z, 'val': 9999}                  

    #THIS PART IS NOT WORKING BUT IS PART OF WHAT I WANT TO BE ABLE TO DO   
    originalMessage = input("Please input your message to be hidden: ")
    print(originalMessage)
    oMessageSplit = originalMessage.split()
    print(oMessageSplit) 



    sampleList = ['L', 'O', 'L']

    phoneCipherDict = dict((x['id'], x['val']) for x in phoneCipher)
    listCiphered = [phoneCipherDict[x] for x in sampleList]

    print(listCiphered)


main()

My analysis and Feedback needed:
I believe this seems to be something wrong with maybe its not an integer vs an actual string. If there is no possible way to do this, could someone point me in the right direction to what method to use for something like this?

  • 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-18T05:09:14+00:00Added an answer on June 18, 2026 at 5:09 am

    Try this:

    phoneCipher = {'id' : 'A', 'val': 2},{'id' : 'B', 'val': 22},{'id' : 'C', 'val': 222},...
    

    The key should be the string 'L', just L will try to use the value of variable L as key.

    Update

    For creating a list from string, use

    sampleList = list(originalMessage)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a simple server application which runs on the desktop, and
i want to create a simple search function with an input field where the
I want to create simple dummy tag which can work with Struts2. I have
I want to create a simple PushButton class which wraps an InterruptPort . I'd
i want create simple app in which i want get the image from sdcard
Hi i want create simple apps.i use the one customclass which name like a
I want to create simple select menu which changes <div> layers in JSF page.
I want to create simple drawing program; Here I my program's mousePressed and mouseDragged
I want to create a simple app which shows infos on the global quick
I want to create a simple formular which leads the user to 2 different

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.