#!/usr/bin/env python # -*- coding: utf-8 -*- import sys #main programme if(__name__ == "__main__"): lValues = [] #extract values for iIndex, pEntry in enumerate(sys.argv): #skip first entry #as it is the programme name if(iIndex == 0): continue #convert them to floats lValues.append(float(pEntry)) fResult = 0.0 #sum up all values for fEntry in lValues: fResult += fEntry*fEntry #print result print '%.16f' % fResult