Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Midpoint

# Hello World program in Python
    
print "Hello World!\n"

print 7/4 

print "What is the midpoint between A(5,4) and B(-2,7)"

print 'x midpoint is:',(5.0+2.0)/2.0
#take both both x values and add them.
# Use decimals because or else you will end up with integers.
print 'y midpoint is:',(4.0+7.0)/2.0
#If you have a error it will tell you what line it went wrong and to look through it.


print 'midpoint is:',(5.0+2.0)/2.0,(4.0+7.0)/2.0

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.