gpt-3.5-turbo-0613· openai
Suzhen/CodeChat
Write a program for adding two variable
- User
Write a program for adding two variable
- Assistant
Sure, here is a program in Python that adds two variables together:
# Step 1: Declare and assign values to the variables num1 = 10 num2 = 5 # Step 2: Add the two variables together sum = num1 + num2 # Step 3: Print the sum print("The sum of", num1, "and", num2, "is:", sum)This program declares two variables
num1andnum2with values 10 and 5 respectively. It then adds the two variables together and stores the result in thesumvariable. Finally, it prints the sum using theprint()function.