名称错误:名称“ pynative”未定义

时间:2020-05-16 16:26:25

标签: python-2.7

使用python2.7.18运行代码后,我将遇到以下错误。

File "<string>", line 1, in <module>
NameError: name 'pynative' is not defined

代码:

import string
def removechars(stri1,num):
    if num < len(stri1):
        new_string = stri1[num:]
        print(new_string)
    else:
        print('Cannot remove characters from the string')
string1 = input('Enter a string ')
print('the entered string is ',string1)
num1 = int(input('Enter the number of characters you want to remove from earlier string'))
print('The new string is ')
removechars(string1,num1)

0 个答案:

没有答案