Level 2
Moderators: UncleTimmy, mjpieters
Enjoying the challenge? Need a hint?Make a donation and help keep the site running! -thesamet
72 posts
• Page 3 of 5 • 1, 2, 3, 4, 5
how do i get started
Hello. I'm completely new to Python (though not to programming) and I'm getting an EOL error after entering the big mess using input just after "<--" even though im doing string.replace("\n","") after reading the input but before my "solving" algorithm...
Can't seem to find the reason. Can anyone point me out in the right direction? Also, when trying to use a file, if I use open(filename.yyy), where should I put filename.yyy? I can't find the "root" directory where the python binary resides.
***EDIT***
The program logic is easy and I have it working already, I just want to know how to be able to cut & paste strings WITH newline character withouth crashing my program.
Can't seem to find the reason. Can anyone point me out in the right direction? Also, when trying to use a file, if I use open(filename.yyy), where should I put filename.yyy? I can't find the "root" directory where the python binary resides.
***EDIT***
The program logic is easy and I have it working already, I just want to know how to be able to cut & paste strings WITH newline character withouth crashing my program.
Muhahaha
You don't even need python(or for that matter any language) to solve this.
Just notepad. Although with 6K plus operations at once it does tend to freeze up sort of... so, an advanced editor is preferred.
I hope I don't specifically need python on the latter ones. I used C for the first level.
You don't even need python(or for that matter any language) to solve this.
Just notepad. Although with 6K plus operations at once it does tend to freeze up sort of... so, an advanced editor is preferred.
I hope I don't specifically need python on the latter ones. I used C for the first level.
well well well
might look a bit lame but here goes ma code
file = open('crypt.txt', 'r')
outf = open('output.txt', 'w')
while 1:
char = file.read(1)
if char == '#' or char == '&' or char == '@' or char == '$' or char == '!' or char == '*' or char == '^' or char == '{' or char == '}' or char == '_' or char == '(' or char == ')' or char == '*' or char == '+' or char == '[' or char == ']' or char == '%' :
char = '_'
outf.write(char)
if not char: break
# print char
file.close()
outf.close()
import sys
sys.exit()
might look a bit lame but here goes ma code
file = open('crypt.txt', 'r')
outf = open('output.txt', 'w')
while 1:
char = file.read(1)
if char == '#' or char == '&' or char == '@' or char == '$' or char == '!' or char == '*' or char == '^' or char == '{' or char == '}' or char == '_' or char == '(' or char == ')' or char == '*' or char == '+' or char == '[' or char == ']' or char == '%' :
char = '_'
outf.write(char)
if not char: break
# print char
file.close()
outf.close()
import sys
sys.exit()
the hint i needed:
don't forget that python dictionaries don't preserve order.
be carfull pasting to ipython
Pasting into IPytong messes up the data.
So the way to paste it properly with Ipython is as follows:
Enter IPython
within IPython enter editor (default editor - could be vi) by writing "edit"
then
text='''<paste with right
click>'''
and then work it out.
So the way to paste it properly with Ipython is as follows:
Enter IPython
within IPython enter editor (default editor - could be vi) by writing "edit"
then
text='''<paste with right
click>'''
and then work it out.
Hello,
I understand what I am supposed to do its just when ever I implement the source code into python, the code pops up teal color instead of green. The only way to change this to green is to go to the end of the line and delete the non-existent space. This will join the code back with the other code and then turn green, its a problem with the word-rap.
Is there an easy way to bring the code in and only have python do the word-rap not keep the word-rap from the source?
Thanks!
I understand what I am supposed to do its just when ever I implement the source code into python, the code pops up teal color instead of green. The only way to change this to green is to go to the end of the line and delete the non-existent space. This will join the code back with the other code and then turn green, its a problem with the word-rap.
Is there an easy way to bring the code in and only have python do the word-rap not keep the word-rap from the source?
Thanks!
72 posts
• Page 3 of 5 • 1, 2, 3, 4, 5
Return to Python Challenge Hints
Who is online
Users browsing this forum: No registered users and 5 guests
