Re: [Tutor] Python Challenge Online - 30 Questions
On 01/03/2018 14:36, Julien Carlier wrote: Hi Tim, I didn't send this message to several groups. I sended this message to 20 people from the same group. I will take care to choose relevant groups. What is considered good form? Regards, Julien Replied off-list TJG ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge Online - 30 Questions
On 01/03/2018 13:36, Julien Carlier wrote: Cisco & Dimension Data organize a Python Challenge on EDITx. It is a good way to test your skills & have fun. [... snip ...] You've just cross-posted this to several Python mailing lists / newsgroups, some of them certainly irrelevant. This is not considered good form. TJG ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] Python Challenge Online - 30 Questions
Hello, Cisco & Dimension Data organize a Python Challenge on EDITx. It is a good way to test your skills & have fun. -> https://editx.eu/it-challenge/python-challenge-2018-cisco-and-dimension-data Rules are simple: 15 minutes online, 30 questions & 3 jokers. Everyone is allowed to participate but only belgian residents can win the prizes. Do not hesitate to share it with people that might be interested. Feedbacks are welcome :) Regards, Julien -- Frankenstraat - Rue des Francs 79 1000 Brussels ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python challenge and decryption
Hi again list! I've been trying to implement the feedback I got. So far, I removed the print statements from the function, limited the range (just for the z at the moment) and tried to get all printing in one or two lines... but without success... I don't know if I'm doing the join as it should... The new list I ended up trying to populate it with 2 different ways, but without success when joined... This is the new (and a improved) code: import string def decrypt(cypheredText, shiftedCypherNumber): ''' This function will take two arguments. The first is the cyphered text, the second is the number of characters we need to shift the text so we can decrypt it. This is a Caesar cypher. ''' for letter in cypheredText: asciiValue = ord(letter) if asciiValue in range(97, 123): asciiValue += shiftedCypherNumber if asciiValue 122: asciiValue -= 26 newLetter = chr(asciiValue) text = list() text.append(newLetter) joinedText = ' '.join(text) return joinedText text = 'g fmnc wms bgblr rpylqjyrc gr zw fylb' a = decrypt(text, 2) print a For the new list (text), I initially tried to do it like this - text = list(newLetter) and only now resorted to the append... which way is more correct? Or which is not correct at all? And why is the return giving me just one letter? (the last one...) Thanks for all the tips so far. The maketrans like suggested probably would be faster but I didn't knew about it and now that I'm trying to grind this on my own I kind of prefer it... I'm learning more then if I used a function or something... The ASCII table was invaluable in making me rethink my approach! Merry Christmas to all in the list! In case someone doesn't believe in it, have a very nice weekend and all the best! Joaquim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python challenge and decryption
Posting as HTML caused your indentation to be all wrong. Try to post as plain text to remove those errors. Thankfully your program is not very complicated. import string def decrypt(cypheredText, shiftedCypherNumber): ''' This function will take two arguments. The first is the cyphered text, the second is the number of characters we need to shift the text so we can decrypt it. This is a Caesar cypher. ''' for letter in cypheredText: asciiValue = ord(letter) if asciiValue in range(97, 123): asciiValue += shiftedCypherNumber if asciiValue 122: asciiValue -= 26 newLetter = chr(asciiValue) text = list() text.append(newLetter) joinedText = ' '.join(text) return joinedText text = 'g fmnc wms bgblr rpylqjyrc gr zw fylb' a = decrypt(text, 2) print a You have very little range checking which means that it is very likely to not work (or behave oddly) for unexpected values. The biggest flaw I see is that your list is created at the wrong level. It should be outside the for loop. The problem with list creation being in the for loop is that you create a new list each iteration of the for loop and what happens to the old list? You lose it. If you created the list outside the for loop and my indentation above is incorrect then you created and appended to it after finishing your for loop. This would be incorrect because what would happen to all the values calculated inside the for loop? They would be lost. Either way, it is incorrect. You should declare text before the for loop and then append to it inside the for loop. The above is why you only get one letter and also why text=list(newLetter) is incorrect for your problem. Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423 -- This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python challenge and decryption
On 23/12/11 16:58, Joaquim Santos wrote: Thanks for all the tips so far. The maketrans like suggested probably would be faster but I didn't knew about it That's exactly the point. Very few people know about maketrans before they take the Python Challenge. But that's the whole point of the challenge, as you go through it you will discover new and powerful tools in the Python library that save you from having to invent your own. (Look out for the hints and pointers in the challenge!) If you try to complete the Python challenge without using new modules you will have a very long project in front of you!! -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python challenge and decryption
That's exactly the point. Very few people know about maketrans before they take the Python Challenge. But that's the whole point of the challenge, as you go through it you will discover new and powerful tools in the Python library that save you from having to invent your own. (Look out for the hints and pointers in the challenge!) If you try to complete the Python challenge without using new modules you will have a very long project in front of you!! -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ ___ Exactly. That's how I found out about it - after solving the challenge the other way! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python challenge and decryption
Hi List! Thanks for all the input you guys gave me! I'm trying to implement your ideas on the function and I've been getting some parts right (the correct translation, still vertical and without spaces) or the wrong translation but with spaces... My problem is my range check. I'm also getting a funny problem with return, but I'll ask about it later. What I would like to know now, because it would help me a lot to draw my solution(I like to make sketches/line numbers while I'm thinking) was where to get the ascii table for Python! I searched and got a lot of modules and stuff to install and print it out but no printed online version? You can find for other languages, so where is the one for Python? I know I could install the said modules/scripts but I just think this should also be somewhere... -- Joaquim Santos http://js-vfx.com http://js-vfx.com/ *linkedin* ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python challenge and decryption
On 12/21/2011 06:39 AM, Joaquim Santos wrote: Hi List! Thanks for all the input you guys gave me! I'm trying to implement your ideas on the function and I've been getting some parts right (the correct translation, still vertical and without spaces) or the wrong translation but with spaces... My problem is my range check. I'm also getting a funny problem with return, but I'll ask about it later. What I would like to know now, because it would help me a lot to draw my solution(I like to make sketches/line numbers while I'm thinking) was where to get the ascii table for Python! I searched and got a lot of modules and stuff to install and print it out but no printed online version? You can find for other languages, so where is the one for Python? I know I could install the said modules/scripts but I just think this should also be somewhere... ASCII predated Python by some 40 years. So any reference that is accurate would do. But you can make your own table quite trivially with a simple loop: for ordinal in range(ord( ), 128): print ordinal, -, chr(ordinal) ASCII codes below are control codes, such as newline and tab. ASCII is a 7-bit code, so the highest value is 127. -- DaveA ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] Python challenge and decryption
Hi list! This is my first post here but I've been following the list for some time now! I know that recently there was a message about decryption and all. I think that was what made me go back into the Python challenge and try to solve some of them... For the second one, I first laid on paper my ideas, about user interaction (or input) and what would do what. I haven't implemented the user input yet but as I tested I ended up having some problems. Anticipated but still annoying... My Python version is 2.7.1 and my OS is Linux Mint 11. My code is this one: def decrypt(cypheredText, shiftedCypherNumber): ''' This function will take two arguments. The first is the cyphered text, the second is the number of characters we need to shift the text so we can decrypt it. This is a Caesar cypher. ''' crypticText = list(cypheredText) for letter in crypticText: asciiValue = ord(letter) asciiValue += shiftedCypherNumber newLetter = chr(asciiValue) print newLetter This solves the riddle, however some characters are not correctly decyphered (a is coming back as {...) and prints the solution like this: r e c o m m e n d e d 0 n o w { p p l y o n t h e u r l - How can I make this Human readable? ... Print the letters in just one (or more) lines and maybe replace the for spaces (This one I suppose it could/should be done with whitespaces() or just making a loop to check and change those for ' '.) Thanks for your time! -- Joaquim Santos http://js-vfx.com http://js-vfx.com/ *linkedin* ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] Python Challenge 2
I did this and got this string :- i hope you didnt translate it by hand. thats what computers are for. doing it in by hand is inefficient and that's why this text is so long. using string.maketrans() is recommended. now apply on the url Is that the answer because it does not solve the problem when I apply it to the url. First they came for the Danes, but I did not speak out because I am not a Dane. - Support the World Aids Awareness campaign this month with Yahoo! for Good___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge 2
David Holland [EMAIL PROTECTED] wrote i hope you didnt translate it by hand. thats what computers are for. doing it in by hand is inefficient and that's why this text is so long. using string.maketrans() is recommended. now apply on the url Is that the answer because it does not solve the problem when I apply it to the url. I believe (its a while since I did the challenge) that you have solved it and got to that page. However you could have solved it the hard way so the note is telling you the esy way. Now apply that easy way to the url to get the url of the next challenge. At least thats how I remember it, but it is an adventure game after all... Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge 2
I did this and got this string :- i hope you didnt translate it by hand. thats what computers are for. doing it in by hand is inefficient and that's why this text is so long. using string.maketrans() is recommended. now apply on the url Is that the answer because it does not solve the problem when I apply it to the url. Not to the whole url! Then it wouldn't be a url anymore! Just to ___.html part that is three letters long. And generally you shouldn't post answers to the challenges on public lists, because they can spoil it for others wanting to take the challenge. JS ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Python Challenge
Greetings: Here's a fun site, though probably geared more for intermediate Python programmers, than for beginners: http://www.pythonchallenge.com/ It's 33 levels of riddles that can be solved with Python in some way or another. =) So you have the site up in your browser, and your Python interpreter up, and you try to solve each riddle to get to the next level. There isn't much mouse work involved... you can't *click* your way through it. You have to think of Python solutions to solve each riddle. Each riddle is a combination of a picture and a clue, or hint. Read the hint, and study the picture carefully to figure out what to do. Happy Programming! -- bhaaluu at gmail dot com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] python challenge 2
devayani barve wrote: this is what i did for level 2 of python challenge: dict={'a':'c','b':'d','c':'e','d':'f','e':'g','f':'h','g':'i','h':'j','i':'k','j':'l','k':'m','l':'n','m':'o','n':'p','o':'q','p':'r','q':'s','r':'t','s':'u','t':'v','u':'w','v':'x','w':'y','x':'z','y':'a','z':'b','.':'.',':',(:(,):), : } s=g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj. f=file('book.txt','w') f.write(s) f.close() f=file('book.txt') k=[] while True: line=f.readline() if len(line)==0: break k=[line] list=[] for elem in k: for c in elem: temp=dict[c] print dict[c], And i got this: i h o p e y o u d i d n t t r a n s l a t e i t b y h a n d . t h a t s w h a t c o m p u t e r s a r e f o r . d o i n g i t i n b y h a n d i s i n e f f i c i e n t a n d t h a t ' s w h y t h i s t e x t i s s o l o n g . u s i n g s t r i n g . m a k e t r a n s ( ) i s r e c o m m e n d e d . n o w a p p l y o n t h e u r l . I pasted the above text in the url before .html and got permission denied!!! is my solution wrong? apply on the url. run the previous solution's url through your program. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] python challenge 2
devayani barve wrote: this is what i did for level 2 of python challenge: Please don't post verbatim solutions to the challenges, let's leave some challenge in it for those who come after. Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] python challenge 2
devayani barve wrote: this is what i did for level 2 of python challenge: Please don't publish challenge solutions. That defeats the purpose of the challenge. That said your program takes a very circuitous route to iterate thru a string. Why not just: dict = ... s = ... for c in s: print dict[c], Also since dict and list are built-in functions it is not a good idea to reassign these names. -- Bob Gailer 510-978-4454 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python challenge
David Holland wrote: I looked at this and got stuck on the first one :- Thanks for this. I missed it the first time it showed up on this list. Kinda fun and reminds me why I love python. Four lines in the interactive interpreter and most of the challenges are solved. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python challenge
Jason, Thanks that helped me work it out. David Jason Massey [EMAIL PROTECTED] wrote: David,What answer did you get? One of the things to rember on the challenge is to take your answer and put ".html" (no qutoes) on the end of it in the url.So for the first problem the url would be: http://www.pythonchallenge.com/pc/def/your answer.htmlOn 5/4/06, David Holland [EMAIL PROTECTED] wrote: I looked at this and got stuck on the first one :- http://www.pythonchallenge.com/pc/def/0.html It says try changing the url. I assumed that it either meant 2*38 or 2 to the power of 38 but I can't see how to put either of those in the url.What have I missed ?Thanks in advance. David Holland Yahoo! Photos NEW, now offering a quality print service from just 7p a photo. ___Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor First they came for the Danes, but I did not speak out because I am not a Dane.Send instant messages to your online friends http://uk.messenger.yahoo.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Python challenge
I looked at this and got stuck on the first one :- http://www.pythonchallenge.com/pc/def/0.html It says try changing the url. I assumed that it either meant 2*38 or 2 to the power of 38 but I can't see how to put either of those in the url.What have I missed ?Thanks in advance.David Holland Yahoo! Photos NEW, now offering a quality print service from just 7p a photo.___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python challenge
David,What answer did you get? One of the things to rember on the challenge is to take your answer and put .html (no qutoes) on the end of it in the url.So for the first problem the url would be: http://www.pythonchallenge.com/pc/def/your answer.htmlOn 5/4/06, David Holland [EMAIL PROTECTED] wrote: I looked at this and got stuck on the first one :- http://www.pythonchallenge.com/pc/def/0.html It says try changing the url. I assumed that it either meant 2*38 or 2 to the power of 38 but I can't see how to put either of those in the url.What have I missed ?Thanks in advance. David Holland Yahoo! Photos – NEW, now offering a quality print service from just 7p a photo. ___Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge Level 6
I'm stuck on 6 too. I found the comments but I can't make any sense of them. Any hints? Kent Roel Schroeven wrote: Orri Ganel wrote: Hello all, First and foremost, for those who don't know, www.pythonchallenge.com is a set of python-related riddles. Now, for those who are past level six, any sort of hint would be appreciated. Right now, all I know is what module to use (i think) and that I have to somehow use it on channel.jpg . . . I have no idea how to do this. The module I think I'm supposed to use is , which I derived from the comment in the source of the page and the presence of a certain object in the picture. You need to apply that module, but not to the jpeg. Find the zip first!! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge Level 6
Kent Johnson wrote: I'm stuck on 6 too. I found the comments but I can't make any sense of them. Any hints? I'm sorry, I can't make it any clearer without giving it away. Maybe you can try to search the forum (http://www.pythonchallenge.com/forums) for more clues. Kent Roel Schroeven wrote: Orri Ganel wrote: Hello all, First and foremost, for those who don't know, www.pythonchallenge.com is a set of python-related riddles. Now, for those who are past level six, any sort of hint would be appreciated. Right now, all I know is what module to use (i think) and that I have to somehow use it on channel.jpg . . . I have no idea how to do this. The module I think I'm supposed to use is , which I derived from the comment in the source of the page and the presence of a certain object in the picture. You need to apply that module, but not to the jpeg. Find the zip first!! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
Liam Clarke wrote: This matches '[A-Z]{3}[a-z]{1}[A-Z]{3}' 477 occurences... so I hope that it's all the same letter. You have to many occurences because that regex matches XXXxXXX, but also XXxXX. You should only match exactly 3 guards on each side. IIRC I used something like (sadly I threw my code for levels 1 and 2 away): '[^A-Z][A-Z]{3}[a-z]{1}[A-Z]{3}[^A-Z]' -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
This matches '[A-Z]{3}[a-z]{1}[A-Z]{3}' 477 occurences... Doesn't the {3} mean a minimum of 3? I may be wrong, its not a feature I use much but I thought there was a gotcha with the {} notation that meant you had to provide a terminating character too? Alan G. (Who has only just started on these riddles...) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
Hey Liam thanks again for the hint. I have finally managed to use the ???trans function. But now apply it to the URL, I am lost again. (I did apply it to the URL-twice) but nope, nothing is happening. One more hint if possible. Thanks JC ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
At 10:52 AM 5/10/2005, John Carmona wrote: Hey Liam thanks again for the hint. I have finally managed to use the ???trans function. But now apply it to the URL, I am lost again. (I did apply it to the URL-twice) but nope, nothing is happening. One more hint if possible. How did you apply the preceding solutions to the URL? Bob Gailer mailto:[EMAIL PROTECTED] 510 558 3275 home 720 938 2625 cell ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
Alan Gauld wrote: This matches '[A-Z]{3}[a-z]{1}[A-Z]{3}' 477 occurences... Doesn't the {3} mean a minimum of 3? It's exactlu equivalent to [A-Z][A-Z][A-Z] I may be wrong, its not a feature I use much but I thought there was a gotcha with the {} notation that meant you had to provide a terminating character too? If you want to prevent e.g. 'ABCDE' from matching as opposed to only 'BCD', yes, you need some kind of terminator. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
This is what I did. I have tried the whole field, part of the URL (after the .com), etc.. I Just get the old 404 not found message. JC ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
copied the URL, paste it in my script in Python and run it (once) did not get nowhere, then did it a second time, and again did not get nowhere. JC ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
???trans function. But now apply it to the URL, I am lost again. Its not strictly accurate, it means apply it to a section of the address... Alan G. (I'm catching up! All the previous posts help of course :-) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
John Carmona wrote: This is what I did. I have tried the whole field, part of the URL (after the .com), etc.. I Just get the old 404 not found message. You just need to apply it to the basename of the filename. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
To all thanks I have got it now!!! JC ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Python Challenge Level 6
Hello all, First and foremost, for those who don't know, www.pythonchallenge.com is a set of python-related riddles. Now, for those who are past level six, any sort of hint would be appreciated. Right now, all I know is what module to use (i think) and that I have to somehow use it on channel.jpg . . . I have no idea how to do this. The module I think I'm supposed to use is , which I derived from the comment in the source of the page and the presence of a certain object in the picture. Thanks in advance, Orri -- Email: singingxduck AT gmail DOT com AIM: singingxduck Programming Python for the fun of it. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Python Challenge - Riddle 2
OK I am stuck on this one. I see what I need to do (correct me if I am wrong). But I need to write a script that will replace each letter by another one (In this case a -- c etc.). I look at String, List and Dictionary. I thought I could use the text.replace option but I am not sure. Anybody to put me in the right track. Also how can I add my work email address (but keeping this one) to have the mail forwarded to me, they have cut access to my hotmail at work and I am wasting too much time in waiting to go home to check my emails from Python.org. Many thanks JC ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
Hi John, took me awhile to solve this one too, it's quite good, teaches you about a part of Python that you wouldn't normally use. Do you want hints or spoilers? I've give hints for now, search the Python docus for 'trans', check the string methods. Hope that didn't make it too obvious. Now, if anybody can assist me with problem 3... Good luck, Liam Clarke On 5/9/05, John Carmona [EMAIL PROTECTED] wrote: OK I am stuck on this one. I see what I need to do (correct me if I amwrong). But I need to write a script that will replace each letter byanother one (In this case a -- c etc.). I look at String, List and Dictionary. I thought I could use the text.replace option but I am not sure.Anybody to put me in the right track.Also how can I add my work email address (but keeping this one) to have themail forwarded to me, they have cut access to my hotmail at work and I am wasting too much time in waiting to go home to check my emails fromPython.org.Many thanksJC___Tutor maillist- Tutor@python.orghttp://mail.python.org/mailman/listinfo/tutor-- 'There is only one basic human right, and that is to do as you damn well please. And with it comes the only basic human duty, to take the consequences.' ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
Thanks Liam, I will start checking this afternoon. Regards JC ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
Hi John, took me awhile to solve this one too, it's quite good, teaches you about a part of Python that you wouldn't normally use. Do you want hints or spoilers? I've give hints for now, search the Python docus for 'trans', check the string methods. You can also do it with a convoluted list comprehension - that's what I did. Alan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
Hmmm... the forums don't overly explain level 3. Am I looking for something like this - XXXjXXX? or something like XjXX or XXjX? I've also looked for - ooXXXoo XXXjXXXooXXXoo and oooXooo oooXooo oooXooo XXXjXXX oooXooo oooXooo oooXooo Argh. My head is going to explode. On 5/10/05, Roel Schroeven [EMAIL PROTECTED] wrote: John Carmona wrote: OK I am stuck on this one. I see what I need to do (correct me if I am wrong). But I need to write a script that will replace each letter by another one (In this case a -- c etc.). I look at String, List and Dictionary. I thought I could use the text.replace option but I am not sure. Anybody to put me in the right track.There are different ways to do this; IIRC I did it using ord, chr and alist comprehension. Note that there is a forum for hints: http://www.pythonchallenge.com/forums/--If I have been able to see further, it was only because I stoodon the shoulders of giants.-- Isaac Newton Roel Schroeven___Tutor maillist-Tutor@python.orghttp://mail.python.org/mailman/listinfo/tutor -- 'There is only one basic human right, and that is to do as you damn well please.And with it comes the only basic human duty, to take the consequences.' ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
Am I looking for something like this - XXXjXXX? or something like XjXX or XXjX? I've also looked for - Take the challenge's hint a little more literally, it's quite specific. This one had me stumped for a little while until I realized my mistake. Alan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Challenge - Riddle 2
Am I looking for something like this - XXXjXXX? or something like XjXX or XXjX? The former: 3 on each side. Exactly 3. BTW wink, you can check your understanding by saving the image you get from riddle 6, compressing it with zlib, filtering out all but string.letters and looking for the same pattern as in riddle 2. You should come up with scdehtinjgu...but that's a 404 for a web page. /c ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor