この擬似コードの使用:
1。数値をフロートとして宣言します
2.ルートをフロート
として宣言します3.応答を文字として宣言します
4.書き込みDo you want to find the square root of a number?
5.書き込みEnter ‘y’ for yes, ‘n’ for no:
私がコーディングしたもの:
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
。
例:
Response = input('Do you want to find the square root of a number?\nEnter y for yes, n for no: ')
出力:
Do you want to find the square root of a number?
Enter y for yes, n for no:
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加