0% found this document useful (0 votes)
2 views1 page

Python Programming Assignments Solutions

The document contains code for three programming assignments. Assignment 1 calculates the sum of squares of integers from 1 to n. Assignment 2 computes the average of a list of integers, while Assignment 3 identifies the most frequently occurring integer in a list.

Uploaded by

karthikeyan.mht
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Python Programming Assignments Solutions

The document contains code for three programming assignments. Assignment 1 calculates the sum of squares of integers from 1 to n. Assignment 2 computes the average of a list of integers, while Assignment 3 identifies the most frequently occurring integer in a list.

Uploaded by

karthikeyan.mht
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Week Assingment 2 Code:

Programming Assignment 1
n=int(input())
ans=0
for i in range(1,n+1):
ans+=i*i
print(ans,end="")

Programming Assignment 2
n=[int(i) for i in input().split()]
sum=0
for x in n:
sum+=x
print(round(sum/len(n)),end="")

Programming Assignment 3
n=[int(i) for i in input().split()]
dict={}
for i in set(n):
dict[[Link](i)]=i
print(dict[max([Link]())],end="")

You might also like