您的位置:澳门新葡8455最新网站 > 编程教学 > ord() expected string of length 1, but int found

ord() expected string of length 1, but int found

发布时间:2019-12-02 18:02编辑:编程教学浏览(88)

    源代码是那般:

    s=b'^SdVkT#S ]`Y\!^)x8fx80ism'
    key=''
    for i in s:
         i=ord(i)-16
         key+=chr(i^32)
    print (key)

    运行前边世了难题:ord(卡塔尔 expected string of length 1, but int found

    故此现身那几个难点,是在字符串调换进度中冒出了三个小错误,在黄金时代多级百度和谷歌(Google卡塔尔(قطر‎后,开掘概念照旧很迷糊,但是在曙光大佬的解答后,精晓了怎么管理,就是在s后加””,运营后意识完美扫除

    本文由澳门新葡8455最新网站发布于编程教学,转载请注明出处:ord() expected string of length 1, but int found

    关键词: