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

  • Home
  • SEARCH
  • 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 8798483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:06:25+00:00 2026-06-14T00:06:25+00:00

I am creating a program that uses the Caesar cipher to encode and decode

  • 0

I am creating a program that uses the Caesar cipher to encode and decode messages. So far I am building the groundwork, I am trying to get my list of characters the user gives me and make a list of integers using ord…So far all I am having trouble with is getting my integers that I have received back into a list.

import random

encode_decode = input("Do you want to encode, or decode? (e/d)")

shift_amount = input("Please enter the shift amount for your message")

if encode_decode == "e" or encode_decode == "E":
    user_words_unrefined = input("Enter your message to encode!")
elif encode_decode == "d" or encode_decode == "D":
    user_words_unrefined = input("Enter your message to decode!")

user_words_refined = list(user_words_unrefined)

Alphabet = [chr(i) for i in range(ord('a'), ord('z') + 1)]

Counter = 0
for i in range(len(user_words_refined)):
    user_words_numbers = (ord(user_words_refined[Counter]))
    user_numbers_list = [user_words_numbers]
    print(user_numbers_list)
    Counter += 1

Input (“Hello, Party people!”)
output
it prints them all on seperate lines with square brackets around them…any ideas?

[72]
[101]
[108]
[108]
[111]
[44]
[32]
[80]
[97]
[114]
[116]
[121]
[32]
[112]
[101]
[111]
[112]
[108]
[101]
  • 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-14T00:06:28+00:00Added an answer on June 14, 2026 at 12:06 am

    This should sort you out. see the comments in the code. I will be happy to provide further explanation if need be

    user_numbers_list = []    #initialise the list
    Counter = 0
    for i in range(len(user_words_refined)):
        user_words_numbers = (ord(user_words_refined[Counter]))
        user_numbers_list.append(user_words_numbers)     #add to the end of the list
        print(user_numbers_list)
        Counter += 1
    

    The best bet is actually list comprehension… see Jordan Lewis’s answer for a neater approach

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

Sidebar

Related Questions

I am creating a program that uses JFrame, JPanel, JLabel and all other sorts
I am creating a .NET program that uses odp.net, specifically the 11g version. Our
I am creating a Java program that uses a GUI to display a mortgage
I'm creating a setup program in VS2008 for a C# application that uses SQLite,
I'm creating a basic C program that uses the mysql api. I'm on windows,
So the quick background is I am creating a java program, that uses many
I'm creating a program that uses the CodeProject CoreAudioApi (pretty popular framework for manipulating
I am creating a program that uses an array of objects declared with Element
I'm trying to write a program that uses sockets to connect with other instances
Bassicly im creating a program that reads information from an xml file into a

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.