Найти - Пользователи
Полная версия: Ребята HELP!
Начало » Python для новичков » Ребята HELP!
1
PythoNob
Задача стоит в том, чтобы написать DES на Python
Столкнулся с проблемой:
for i in iptab:
ipmassiv + bittext
Traceback (most recent call last):
File “C:\Python27\Bin”, line 11, in <module>
ipmassiv + bittext
IndexError: string index out of range

Где ipmassiv string , bittext - string , i - integer
PythoNob
PythoNob
Задача стоит в том, чтобы написать DES на PythonСтолкнулся с проблемой:for i in iptab: ipmassiv + bittextTraceback (most recent call last): File “C:\Python27\Bin”, line 11, in <module> ipmassiv + bittextIndexError: string index out of rangeГде ipmassiv string , bittext - string , i - integer

Traceback (most recent call last):
File “C:\Python27\Bin”, line 12, in <module>
print(bittext)
IndexError: string index out of range

при попытке вывести на экран bittext - он выполняет 25 итераций и выводит эту ошибку, с учетом того что в массиве iptab столько же элементов , сколько в строке bittext
alexsis
покажите весь код
terabayt
pyDes
и документация
PythoNob
alexsis
покажите весь код
С этой проблемой разобрался…но чувствую меня ждет веселье(
PythoNob
terabayt
pyDesи документация
Спасиб….почитаю..
PythoNob
bitmassivk = [bin(ord(ch)).zfill(8) for ch in textk] # perevod kli4a v biti
str=“”.join(bitmassivk)
bittextk= str
s=''
delite=
for i in delite:
s=bittextk.replace(bittextk,'')

Результат:
>>> bittextk
'0111101001100001011100110111001001100001011011100110101101100001'
>>> s
'0000000000000000000000000000000'
Почему он не удаляет только те элементы id которого я задаю?!
botinag
Поместите ваш код в
[code python][/code]
А то читать невозможно.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB