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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:41:27+00:00 2026-06-09T11:41:27+00:00

So, I need to input a scrambled alphabet, and then input a secret message

  • 0

So, I need to input a scrambled alphabet, and then input a secret message using that alphabet. My program needs to unscramble the secret message. I have written this so far and am stuck. I was hoping someone could help me. What I tried so far is changing every index in the list to A-Z. My question is how do I use what I wrote for that and make it work for the secret message I input as well.

s = ()

alphabet = input("Please input the scrambled alphabet in order: ")
message = input("Now input the scrambled message: ")
alphabet.upper()
s = dict(alphabet)
num = 1

while num < 2:
    s[0] = chr(65)
    s[1] = chr(66)
    s[2] = chr(67)
    s[3] = chr(68)
    s[4] = chr(69)
    s[5] = chr(70)
    s[6] = chr(71)
    s[7] = chr(72)
    s[8] = chr(73)
    s[9] = chr(74)
    s[10] = chr(75)
    s[11] = chr(76)
    s[12] = chr(77)
    s[13] = chr(78)
    s[14] = chr(79)
    s[15] = chr(80)
    s[16] = chr(81)
    s[17] = chr(82)
    s[18] = chr(83)
    s[19] = chr(84)
    s[20] = chr(85)
    s[21] = chr(86)
    s[22] = chr(87)
    s[23] = chr(88)
    s[24] = chr(89)
    s[25] = chr(90)
    num +=1
print (s)

for alpha in message.upper():
    if alpha < "A" or alpha > "Z":
        print(alpha,end="")
    else:
        print(s [ord(alpha) -65 ], end="")
  • 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-09T11:41:29+00:00Added an answer on June 9, 2026 at 11:41 am

    First, creating the big dictionary s is entirely unnecessary. It literally does nothing: the line:

    s [ord(alpha) -65 ]
    

    Is turning a letter into a number, subtracting 65, and then putting it through a dictionary that adds 65 and turns it back into a number.

    Secondly, the line alphabet.upper() doesn’t actually change the alphabet, it just returns an uppercase version. You need to do

    alphabet = alphabet.upper()
    

    Now for the meaty part. What you meant to do was create a dictionary mapping letters in the code alphabet to letters in the real alphabet. The line dict(alphabet) doesn’t do this. Instead, iterate through the characters in the string and assign each to the corresponding letter. You’re on the right track using chr, but are going to way too much work. How about this:

    s = {}
    for i in range(26):  # iterate from 0 to 25
        s[alphabet[i]] = chr(65 + i)
    

    since chr(65 + i) is the letter in the normal, ordered alphabet, and alphabet[i] is the scrambled one.

    Once you have that dictionary, running through letter by letter and changing it should be easy (and it’s left to you).

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

Sidebar

Related Questions

I need an input box in a UI program that is already written derived
I am thinking about making a program that will need to send input and
I have two EditFeilds that need numeric input. The issue is that that zero
I am using primefaces with JSF. I need a input component that allows users
I have a program that fork() s a new process and then overwrites that
I have code that works but only once. I need an input char a
I have a txt file that contains data which I need to input to
I have a console application where I need to input numbers until enter x.
I have a page where I need to capture input from a user after
I have a homework assignment where I need to take input from a file

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.