假设我有以下代码:
test = input(“What is your message?\n> ”)
print(test)
输出:
What is your message?
> Hi there!
Hi there!
处理已退出,代码为0
但是,Python中有没有一种方法可以使用户在消息中间键入输入? 随着输出:
Percent converter:
> 30%
我输入:“ 30”,而不是“ 30%”。在输入输入之前,有没有办法在Python中做这种事情?
假设我有以下代码:
test = input(“What is your message?\n> ”)
print(test)
输出:
What is your message?
> Hi there!
Hi there!
处理已退出,代码为0
但是,Python中有没有一种方法可以使用户在消息中间键入输入? 随着输出:
Percent converter:
> 30%
我输入:“ 30”,而不是“ 30%”。在输入输入之前,有没有办法在Python中做这种事情?