ezoic

Tuesday, March 7, 2017

Python problem 5

Write a Python program to print all unique values in a dictionary.

class Solution:
    def unique1(self, dict1):
        a1=[]
        for key in dict1.keys():
            a1.append(dict1[key])
        b1=set(a1)

        return(b1)


kk=Solution()
if __name__=="__main__":

    print(kk.unique1({"a":1,"i":1,"u":5}))

No comments:

Post a Comment

R is not a simple programming language, and it does better on reading excel files than python

R is not a simple programming language, and it does better on reading excel files than python . tried to read excel files to python and R. i...