943,670 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Unsolved
  • Views: 400
  • Python RSS
Apr 15th, 2009
0

control structure

Expand Post »
hi
I want to write this code in do while or if else, or any other way except for loop. here is the code
Python Syntax (Toggle Plain Text)
  1. for i in range(65,90):
  2. for j in range(65,90):
  3. for k in range(65,90):
  4. token=chr(i)+chr(j)+chr(k)
  5. block = ((i<<16)+(j<<8)+(k))
  6. cblock = pow(block,e,n)
  7. table[token]=cblock
can anyone please help me to write this in anyother format?
thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pong pong is offline Offline
2 posts
since Nov 2008
Apr 15th, 2009
0

Re: control structure

Click to Expand / Collapse  Quote originally posted by pong pong ...
hi
I want to write this code in do while or if else, or any other way except for loop. here is the code
Python Syntax (Toggle Plain Text)
  1. for i in range(65,90):
  2. for j in range(65,90):
  3. for k in range(65,90):
  4. token=chr(i)+chr(j)+chr(k)
  5. block = ((i<<16)+(j<<8)+(k))
  6. cblock = pow(block,e,n)
  7. 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...
Reputation Points: 355
Solved Threads: 292
Veteran Poster
jlm699 is offline Offline
1,102 posts
since Jul 2008
Apr 16th, 2009
0

Re: control structure

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.
Reputation Points: 35
Solved Threads: 32
Posting Pro in Training
leegeorg07 is offline Offline
428 posts
since Jul 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: find n+2?
Next Thread in Python Forum Timeline: problems with glutInit and related functions





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC