Re: [Tutor] Python Challenge 2

2007-12-21 Thread Tiger12506
>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


Re: [Tutor] Python Challenge 2

2007-12-21 Thread Alan Gauld
"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


[Tutor] Python Challenge 2

2007-12-21 Thread David Holland
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

2006-07-18 Thread Bob Gailer
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 2

2006-07-18 Thread Kent Johnson
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

2006-07-17 Thread Luke Paireepinart
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


[Tutor] python challenge 2

2006-07-17 Thread devayani barve
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?
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor