21和9
写一个Python程序,打印两个数字的总和.
这是一个 Python 程序,它将两个数字作为输入,并打印它们的总数: ``python #take two numbers as input num1 = int(input('Enter first number: ')) num2 = int(input('Enter second number: ')) #calculate the sum sum = num1 + num2 #print the sum print('The sum of', num1, 'and', num2, 'is:', sum) `` If the goal is to print specifically the sum of the numbers 21 and 9, its approach would be: ``python num1 = 21 num2 = 9 sum = num1 + num2 print('The sum of', num1, 'and', num2, 'is:', sum) `` 输出将是: ``` 总数的21和 9 是: `` 30