Python の空白の削除に関する質問と回答をいくつか読みましたが、探しているものを見つけることができませんでした。これは、問題の特定の例を示す小さなプログラムです。大変お世話になりました。
import random
math_score = random.randint(200,800)
math_guess = int(input("\n\nWhat score do you think you earned on the math section (200 to 800)?\t"))
print ("\n\n\nOn the math section, you guessed",math_guess,", and your actual score was",math_score,"!")
だからここに私の問題があります:
プログラムを実行すると、次の結果が得られます。
On the math section, you guessed 600 , and your actual score was 717 !
文中の各変数に続くスペースを削除したいと思います。この場合、600 と "," の間のスペースと 717 と "!" の間のスペース。
この問題にアプローチする標準的な方法はありますか?