需要运行python脚本。我出于某种原因不能这样做

时间:2016-02-22 14:10:41

标签: python python-2.7 python-3.x numpy

好的,所以我写了我的第一个python脚本,我认为这是正确的,但是这个文章很糟糕但是,我的计算机吓坏了,不会打印出我的解密文本,我知道这是正确的,因为我已经工作了它是手工制作的。如果有人这么善良,我需要某人提出的两件事,

1)我是否在python中编写了正确的打印语法? 2)有人可以运行我的python脚本并告诉我你得到的输出结果吗?



# -*- coding: utf-8 -*-
"""

@author: Jonathan DeLorenzo
"""

import numpy as np

a={'A':0,'B':1,'C':2,'D':3,'E':4,'F':5,'G':6,'H':7,'I':8,'J':9,'K':10,'L':11,'M':12,'N':13,'O':14,'P':15,'Q':16,'R':17,'S':18,'T':19,'U':20,'V':21,'W':22,'X':23,'Y':24,'Z':25}
b=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
c='VZLUCCDIFXKHABEQUYIMILQKPLDVANDZEDPMOIEAVXWBKHUSMGOHLTCBSLSXFRWSLSORRHKHDZUHILQKNXBVVYOUMUPBXDORKHFUYJVZTOBZORBZZUORTIHLQVBZKHANBLCTQVLUOIGQULQVMHORVJVZHRBZDIMVABFTLUIMXDDJCBFNBZPOOIDDBYCTSVQVIRGFFHHLBHIFBZISMQVXWBULGSVXIAANKHGBPPESDILUQVGSIOVZDTFAIWHFSXLUGRCTALGSXDORBLIDANKHGBANRKSGKQYJAXVZKPQVCPWMCZCQEDUDEMGSQGNXKSFRNLFCWYQGQQUHAYZGACPGLUZHCGPGBZDQUYOSZLLUWMCZSGKODVXDDJZLLUQWANXNGSMTRVZHMLRGQKVBLUABAKQTORIQDILUQVNXWSIWWMFRQGDOCBIOVEDNESZVRDGBGRGSANOVXDVSFTLUTKAGYOMTDBANDZNHJZLHMTDBNXWSIWCPWMCESEPBALGSIMMTVZNXKTDDFKMTANPSGSBPDI'

d=[(11,4),(7,3)]

h =''

for i in range(0,267):
    e=c[2*i:2*i+2]
    f=e[0]
    g=e[1]
    x1=a[f]
    x2=a[g]
    y1=np.mod(11*x1+4*x2,26)
    y2=np.mod(7*x1+3*x2,26)
    h=h+b[y1]+b[y2]
    print , h




1 个答案:

答案 0 :(得分:2)

您的打印电话不正确。应该是:

print h

for Python 2.x,或者:

print(h)

for Python 3.x