class Solution: """ @param number: A 3-digit number. @return: Reversed number. """ def reverseInteger(self, number): return int(str(number)[::-1]) if __name__ == "__main__": a = input("输入3位整数: ") so = Solution() print(so.reverseInteger(a))
测试结果
2023-12-19 12:41:33
class Solution: """ @param number: A 3-digit number. @return: Reversed number. """ def reverseInteger(self, number): return int(str(number)[::-1]) if __name__ == "__main__": a = input("输入3位整数: ") so = Solution() print(so.reverseInteger(a))
测试结果