Hello everyone in the introduction to the python class, and still enjoy it and can't stop practicing. I have what I think the exercise asks for. One of the questions I have is where do I start listing variables, such as amount, difference, product, and so on. I use Sublime Text and they all look white except for the sum, why? Is this related to things, although when I run the codes do they seem to be accurate?
''' Write a program that prompts the user for two integers and then prints
'''sum, difference, product, average, distance, max and min.
import math
number1 = float(input("Please enter an integer: "))
number2 = float(input("Please enter another integer: "))
print()
print()
sum = number1 + number2
difference = number1 - number2
product = number1 * number2
average = (number1 + number2) / 2
distance = abs(number1 - number2)
maximum = max(number1, number2)
minimum = min(number1, number2)
print("Sum between the two:",sum)
print("Difference between the two:",difference)
print("Product between the two:",product)
print("Average between the two:",average)
print("The distance between the two:",distance)
print("The maximum between the two:",maximum)
print("The minimum between the two:",minimum)
Thank you for your time.
source
share