使用这段伪代码:
1. 声明 Number 为浮点数
2. 声明 Root 为浮点数
3. 声明 Response 为字符类型
4. 输出
5. 输出
1. 声明 Number 为浮点数
2. 声明 Root 为浮点数
3. 声明 Response 为字符类型
4. 输出
你想求一个数的平方根吗?
5. 输出
输入‘y’表示是,输入‘n’表示否:
Response = str(input('Do you want to find the square root of a number? \
Enter y for yes, n for no: '))
在PyCharm运行窗口中的输出:
您想要找到一个数的平方根吗?输入y表示是,n表示否:
期望的格式结果:
Do you want to find the square root of a number?
Enter y for yes, n for no:
\
替换为\n
。 - saud