在我的 python 程序中,用户将输入一个字符串。
如果用户输入的字符串少于五个字母,那么它会告诉用户
字符串太短了!
如果输入的字符串超过 5 个字母,那么它将使大写成为字符串的最后五个字母。
例如:
input: "heroiszero"
output: SZERO
expected output: heroiSZERO
我的程序
myString= input("Enter the string you want:- ")
print("The String you Entered is :- ", myString)
if len(myString) <= 5:
print("String is too short!")
else:
print(myString[-5:].upper())
我应该进行哪些更改才能获得我想要的确切输出?