[英]Can I get Last Digit of an Integer in Python
I am Trying to Find the Last Digit of my Integer.我正在尝试查找我的 Integer 的最后一位数字。 but unable to find it.但无法找到它。
Note -
I am Using.split() in my Working Dish. Note -
我在我的工作盘中使用.split()。
# cooking my dish here
x = str(input())
letters = ""
words = x.split()
for word in words:
letters += word[0]
a = int(word(0) + word[-1])
print(a)
I want to Wrap up all the things with this Error.我想用这个错误来结束所有的事情。
21
Traceback (most recent call last):
File "E:\testererterset.py", line 9, in <module>
a = int(word(0) + word[-1])
TypeError: 'str' object is not callable
>>>
I need serious help.我需要认真的帮助。 You can Also Share Your code below if you want me to Understand Greatly.如果您希望我非常了解,您也可以在下面分享您的代码。 Till then zeez!到那时为止!
word(0)
TypeError: 'str' object is not callable类型错误:'str' object 不可调用
word[0]
Should work.应该管用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.