#!/usr/bin/env python3
class particle:
  color='red'
  # ............................... class particle
  def __init__(self,mass,x,vx):
    self.m=mass
    self.x=x
    self.vx=vx
    self.px=self.m*vx
    # ....................................... move
  def move(self):
    self.x+=self.vx
# ................................................
pt1=particle(10,10,3.5)
pt2=particle(20,15,-2.1)
center=(pt1.m*pt1.x+pt2.m*pt2.x)/(pt1.m+pt2.m)
print('momentum1 = {:.1f}'.format(pt1.px))
print('momentum2 = {:.1f}'.format(pt2.px))
print('center of mass = {:.3f}'.format(center))
print('color1 = ',pt1.color,', color2 = ',pt2.color)
print('initial position particle 1: {:.3f}'.format(pt1.x))
pt1.move()
print('final position particle 1: {:.3f}'.format(pt1.x))



