#🔒 Why are my numbers gettin so big ?

25 messages · Page 1 of 1 (latest)

merry gull
#

I want to exchange my letters trough numbers and at the end their verry big and i dont know why

only_values = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
79, 80, 81, 82, 83, 84, 85, 86, 87, 88]

only_letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D',
'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'ö', 'ä', 'ü', 'Ä', 'Ö', 'Ü', '.', ',',
':', ';', 'è', 'é', 'à', '!', '?', '#', '@', '1', '2', '3', '4', '5', '6',
'7', '8', '9', '+', '-', '_', '(', ')', '=', '*', '~', '/', '&']

big_letters = {'A': 101, 'B': 102, 'C': 103, 'D': 104, 'E': 105, 'F': 106, 'G': 107,
'H': 108, 'I': 109, 'J': 110, 'K': 111, 'L': 112, 'M': 113, 'N': 114,
'O': 115, 'P': 116, 'Q': 117, 'R': 118, 'S': 119, 'T': 120, 'U': 121,
'V': 122, 'W': 123, 'X': 124, 'Y': 125, 'Z': 126, 'Ä': 127, 'Ö': 128,
'Ü': 129}

letter = input("Input your big letter: ")
text = input("Input your Text: ")
big_letter_value = big_letters[letter]

for i in range(len(only_values)):
only_values[i] += big_letter_value

for i in range(len(only_letters)):
text = text.replace(only_letters[i], str(only_values[i]))

print(text)

scarlet berryBOT
#

@merry gull

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

bitter holly
merry gull
#

one sec

#

Input your big letter: A
Input your Text: Hello
11771117731177511771011776117711177111773117711177111773117711177111776
I expect the number to be less than 4 digits because im adding the value of the Uppercase letter up to the value of each number

#

!paste

scarlet berryBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

merry gull
#

i guess thats better but its still dont adding up

#

Input your big letter: A
Input your Text: Hello
1177 1 1177 3 1177 5 1177 1 01177 6 1177 1 1177 1 1177 3 1177 1 1177 1 1177 3 1177 1 1177 1 1177 6

bitter holly
#

The last loop is replacing single digit numbers with three digit numbers.

merry gull
#

28?

bitter holly
#

For example, here, it's about to replace the 3s with 173s:

#

See the two watches at the top

#

On the next iteration, note how text has grown:
And now, all 4s will get replaced with 174

merry gull
#

I have a code that i want to simplify but its pretty long

#

maby it makes more sense if you see the code

#

The whole point of that programm is to decipher and loch a message

bitter holly
merry gull
#

Ok i guess i try to re-code everything, thank you for your help

#

!close

scarlet berryBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.