ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/learning/Mark/power.py
Revision: 591
Committed: Tue Nov 3 22:45:12 2015 UTC (10 years, 4 months ago) by nino.borges
Content type: text/x-python
File size: 248 byte(s)
Log Message:
Moved dir out of main dir.

File Contents

# User Rev Content
1 ninoborges 8 L = [1, 2, 4, 8, 16, 32, 64]
2    
3     X = 5
4    
5    
6    
7     #found = i = 0
8    
9     while not found and i < len(L):
10     if 2 ** X == L[i]:
11     found = 1
12     else:
13     i = i+1
14    
15    
16    
17     if found:
18    
19     print 'at index', i
20    
21     else:
22    
23     print X, 'not found'