zero_shubham1

whats wrong?

Dec 25th, 2015
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1.  
  2. def main():
  3.     print(encrypter(617534))
  4.  
  5.  
  6.  
  7. def encrypter(key_In):
  8.     k= int(key_In)
  9.     list_key= list()
  10.     for i in range(6):
  11.         mod= k%10
  12.         list_key[i]= mod
  13.         k= k-mod
  14.         k= k//10
  15.     return list_key
  16.  
  17. if __name__ == "__main__": main()
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24. ###################the traceback ################
  25.  
  26.  
  27. Traceback (most recent call last):
  28.   File "encryter.py", line 17, in <module>
  29.     if __name__ == "__main__": main()
  30.   File "encryter.py", line 3, in main
  31.     print(encrypter(617534))
  32.   File "encryter.py", line 12, in encrypter
  33.     list_key[i]= mod
  34. IndexError: list assignment index out of range
Add Comment
Please, Sign In to add comment