Search for question
Question

Lab Tasks: (Graded) Chat GPT is not allowed. Task 1: Write a program, where for given data = 'abAbcd DefdfD', create a list from this data. Then, create a tuple from that list. Convert this tuple to dictionary with key as alphabets and value as count. Finally, print the results. Task 2: Write a function union that accepts two dictionaries (whose keys and values are both integers) as parameters and returns a new dictionary that represents a merged union of the two original dictionaries. For example, if two dictionaries ml and m2 contain these pairs: ml m2 {1: 11, 2: 14, 4: 13} {2: 20, 3: -3, 4: 4} The call of union (m1, m2) should return a dictionary that contains the following pairs: {1: 11, 2: 34, 4: 17, 3: -3} Task 3: Write a program to copy the contents of one file "test.txt" to another file "reverse.txt" in reverse order. Also, in the copied file replace all full stops with commas. Copy contents below to a text file and save file as "test.txt" yltneiciffe dna ylkciuq sgnirts gnitsixe fo seipoc desrever dliub ot elba eb lliw uoy. meht htiW .snoitautis eseht ni tuo uoy pleh nac taht seuqinhcet dna sloot ydnah wef a sedulcni nohtyP .redro esrever ni meht htiw krow ot deen eht ecaf yam uoy. edoc ruoy ni netfo sgnirts nohtyP gnisu era uoy nehW

Fig: 1