
Asked in Accenture
You are given a list of integers. Find the sum of the unique numbers in the list.

AnswerBot
2y
Find the sum of unique numbers in a list.
Create an empty set to store unique numbers
Loop through the list and add each number to the set
Sum up the numbers in the set
Devi S
1y
a=[1,2,3,4,1,2,100]
b={}
for i in a:
if i in b.keys():
b[i]+=1
else:
b[i]=1
count=sum([k for k,v in b.items() if v==1])
Atmuri Ganesh
2y
a=[1,2,3,4,1,2,100]
n=[]
for i in a:
if i not in n:
n.append(i)
print(n)
sum=0
for i in n:
sum+=i
print(sum)
Atmuri Ganesh
2y
a=[1,2,3,4,1,2,100]
s=set(a)
sum=0
for i in s:
sum+=i
print(sum)
Add answer anonymously...
Top Python Developer Interview Questions Asked at Accenture
Q. Define a lambda function and provide an example.
Q. What is a namespace and what are its types?
Q. Write code to explain multiple inheritance.
Interview Questions Asked to Python Developer at Other Companies
Top Skill-Based Questions for Accenture Python Developer
Data Structures Interview Questions and Answers
250 Questions
Web Development Interview Questions and Answers
250 Questions
Algorithms Interview Questions and Answers
250 Questions
Python Interview Questions and Answers
200 Questions
C++ Interview Questions and Answers
150 Questions
Django Interview Questions and Answers
20 Questions
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

