So try and run this code for me please:
def trashy(message, move):
message2 = ""
for i in message:
x = ord(i)
message2= message2+chr(x+move)
print(message2)
numbermove = input("How much do you want to shift your letters by?")
something = input("What is your message?")
trashy(something, int(numbermove))
Does it work for you? It doesn't for me... All it does is asks me 2 questions and then promptly screws off. So why? I ran it from the run dialog... and pasting it in the console didn't even get it do ask me for input. I have also tried to do the return statement, which looked like this:
def trashy(message, move):
message2 = ""
for i in message:
x = ord(i)
message2= message2+chr(x+move)
return message2
numbermove = input("How much do you want to shift your letters by?")
something = input("What is your message?")
something2 = trashy(something, int(numbermove))
print(something2)
It doesn't work for me, it just sits there when I paste it into the prompt, and running it from the command line only asks for input and promptly exits.
I have checked my nvda speech viewer, I have checked my nvda history, but it's like the program crashes before it reaches the print statement.
Thing is, the python prompt doesn't complain when I paste in the code. It just sits there, silently, not even asking me for input.
So what did I break? How can I fix it? More importantly, how can I keep that from happening again? I can't code and not see the results of my program.
What is hard is dynamic coding, coding that accepts different input at different times.
This is what truly takes a large amount of effort on a developer's part.