print("Problem 1:\n\n") lbf = float(input("Enter the force measured in lbf: ")) print("The force in Newton is {:6.3f} N.".format(lbf*0.138254954376)) print("\n\n\n\nProblem 2a:\n") accu = 0 for i in range(1,12): accu += i*(i+2)/(i+1)**2 print("The sum is {:6.3f}.".format(accu)) print("\n\n\n\nProblem 2b:\n") accu = 1 for i in range(1,11): accu *= 1-i/(i+10) print("The product is {:9.6f}.".format(accu)) def guk2gus(uk): return uk*0.83267 def rm_punc(string): result = [ ] for letter in string: if letter in ",.:!?": result.append("*") else: result.append(letter) return "".join(result) def lessfour(filename): with open(filename) as infile: for line in infile: words = line.split() if len(words)<=3: #There are three or fewer words in the line print(line.strip())