954,541 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

control structure

hi
I want to write this code in do while or if else, or any other way except for loop. here is the code

for i in range(65,90):
     for j in range(65,90):
         for k in range(65,90):             
             token=chr(i)+chr(j)+chr(k)	 	    
             block = ((i<<16)+(j<<8)+(k))             
             cblock = pow(block,e,n)
             table[token]=cblock

can anyone please help me to write this in anyother format?
thanks

pong pong
Newbie Poster
2 posts since Nov 2008
Reputation Points: 10
Solved Threads: 0
 

hi I want to write this code in do while or if else, or any other way except for loop. here is the code

for i in range(65,90):
     for j in range(65,90):
         for k in range(65,90):             
             token=chr(i)+chr(j)+chr(k)	 	    
             block = ((i<<16)+(j<<8)+(k))             
             cblock = pow(block,e,n)
             table[token]=cblock

can anyone please help me to write this in anyother format? thanks


Why are you looking to get away from the for loop? I believe that is the easiest and most straight forward way to do this....

Note: range(65,90) will only give you letters A through Y. You're missing out on the 'Z'; although perhaps that's what you had intended...

jlm699
Veteran Poster
1,112 posts since Jul 2008
Reputation Points: 355
Solved Threads: 292
 

i think they just want to see if there is any other way to do it, i like to do this every so often to try different things.

leegeorg07
Posting Pro in Training
428 posts since Jul 2008
Reputation Points: 35
Solved Threads: 32
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You