# 获取用户输入的字符串
input_str = input("Please enter a string: ")
# 计算字符串的长度
str_length = len(input_str)
# 输出字符串的长度
print("The length of the input string is:", str_length)
在运行程序之前,请确保已安装了Python解释器。如果没有安装Python
# 获取用户输入的字符串
input_str = input("Please enter a string: ")
# 计算字符串的长度
str_length = len(input_str)
# 输出字符串的长度
print("The length of the input string is:", str_length)
在运行程序之前,请确保已安装了Python解释器。如果没有安装Python