在Python中,可以使用print()函數將內容輸出到控制臺。
print()
例如:
print("Hello, World!")
這會在控制臺上顯示文本 “Hello, World!”。
你還可以將變量或表達式傳遞給print()函數,例如:
x = 5 y = 10 print("The sum of", x, "and", y, "is", x + y)
這會在控制臺上顯示文本 “The sum of 5 and 10 is 15”。