1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Mar 16 17:08:52 2018 @author: beast """ def version1(): a=['a','b','c','d','e'] # list 1 b=['a','b','c','d','e','f','g','h'] # list 2 c=[k for k in (a)if (k in (a) and k not in (b))] # include unique item from list 1 : items are (list1-list2)(set thoery) d=[l for l in (b) if l in (a ) and l in (b) or (l not in (a) and l in (b))] #include all the comman from list 1 and unique from list 2 lst=c+d # append above two comprehensed list to get union of list1 U list2 lst.sort() # not neccessay but makes list easy to understand (sorting in ascending order ) print("\n\na=",a) print("\n\nb=",b) print("\n\nunion=",lst) return lst # make it easy to import and use e.g import union_beast.py and then call union_beast.version1() it will return this union of list def version2(): a=['a','b','c','d','e'] # list 1 b=['d','e','f','g','h'] # list 2 c=[] for k in range (max(len(a),len(b))):# max return maximum number among two or more number so we iterate over max of length of both the list if k <len(a) and a[k] not in (b) : # if length of a is greater than current indexing and element at kth index is not present in list b (ie get List1-list 2 item) c.append(a[k]) # if item is unique to list 1 then append to result list (here c) if k <len(b) and b[k] not in (a) :# same as above logic but here we get item unique to list 2 (here list b) c.append(b[k]) # same append to result list (here c) if k <len(b) and b[k] in (a) : # now add the comman item to list (this is vital step as we only add only one instance of item that are both present in list 1 and list 2) eg if 2 is present in list 1 and list 2 we add only one 2 to result list c.append(b[k]) # append to result list (here c) c.sort() # not neccessary but make the result more eye catchy print("\n\na=",a) #print list 1 print("\n\nb=",b)#print list 2 print("\n\nunion=",c) #print the result if __name__=="__main__": # used to run the function via main loading ...i.e if the module is not imported print("\n----------by version 1------------\n") version1() print("\n\n------------by version 2------------") version2() |
Definition of 3G: 3G is the third generation of wireless technologies. It comes with enhancements over previous wireless technologies, like high-speed transmission, advanced multimedia access and global roaming. 3G is mostly used with mobile phones and handsets as a means to connect the phone to the Internet or other IP networks in order to make voice and video calls, to download and upload data and to surf the net. How is 3G Better?: 3G has the following enhancements over 2.5G and previous networks: Several times higher data speed; Enhanced audio and video streaming; Video-conferencing support; Web and WAP browsing at higher speeds; IPTV (TV through the Internet) support. 3G Technical Specifications: The transfer rate for 3G networks is between 128 and 144 kbps (kilobits per second) for devices that are moving fast and 384 kbps for slow ones(like for pedestrians). For fixed wireless LANs, the speed goes beyond 2 Mbps. 3G is a set of technologies and stand
Comments
Post a Comment
share your thoughts ....