Generate subsets of an array using Python

Problem: If you given a problem to generate subsets of given array , we can use PowerSet concept.

lets say Array = ['Red','Orange','Blue']

the power set is defined as 2 to power of len(Array). 2^3 here.

Run the binary counter from 0 to pow(2,len(Array))
Value of Counter            Subset
    000                    -> Empty set
    001                    -> Red
    011                    -> Red,Orange
   100                     -> Blue
   101                     -> Red,Blue
   110                     -> Orange,Blue
   111                     -> Red,Orange,Blue


def gen_subsets(list_attribs):
    len_set = len(list_attribs)
    power_set = 2 ** len_set
    for i in range(power_set): # this generates the binary sequence
        subsets = ""
        for j in range(len_set): #iterate through the list_attribs positions and check bit is set
            if i & (1 << j):
                subsets +=  list_attribs[j] + ","
        print(subsets[0:-1])
        

My 1st App on App Store - VCalendar

Finally after practicing the iOS dev from many sources, I developed an app called VCalendar which is Indian Calendar app. This app shows the Indian Vedic timings for the current year. This Calendar is based on VenkatRama & Co calendar Ap, India.

I published this app on April 21st on app store. This app shows the sunrise/sunset, Tidhi, Star, Festivals, Rahukalam,Masam,Gulika Kalam etc. There are timezone conversions for these vedic timings also .

If you are an Indian staying abroad, download this calendar.

Here is the link:
https://itunes.apple.com/in/app/vcalendar/id1104625702

Here are few screenshots of the app. more screen shots are there in App Store.

Note: App updated with Telugu language support for 2017 calendar.