gpt-3.5-turbo-0301· OpenAI
WildChat-4.8M (AI2)
write a python code to get sum of two numbers
- User
write a python code to get sum of two numbers
- Assistant
Here's an example code to get the sum of two numbers using Python:
num1 = 10 num2 = 20 # Add two numbers sum = num1 + num2 # Display the sum print('The sum of {0} and {1} is {2}'.format(num1, num2, sum))This will output:
The sum of 10 and 20 is 30You can replace
num1andnum2with any numbers you want to add.