Write a Python program that takes a string as an input where multiple numbers are separated by hashes(#). Your first task is to create a list of numbers and print it. Your second task is to create a...


Write a Python program that takes a string as an input<br>where multiple<br>numbers are separated by hashes(#). Your first task is to<br>create a list of<br>numbers and print it.<br>Your second task is to create a dictionary that will have the<br>index of the<br>list as key, and for the even indices, multiplication from<br>start to that<br>index as value, while for the odd indices, summation from<br>start to that<br>index as value. Finally, print the dictionary.<br>Sample Input 1:<br>1#2#3#4<br>Sample Output 1:<br>[1, 2, 3, 4]<br>{0: 1, 1: 3, 2: 6, 3: 10}<br>Explanation 1:<br>key 0<br>key 1<br>key 2<br>key 3<br>value 1<br>value 1+2 = 3<br>value 1x2x3 = 6<br>value 1+2+3+4 = 10<br>Sample Input 2:<br>5#6#7<br>Sample Output 2:<br>[5, 6, 7]<br>{0: 5, 1:11, 2: 210}<br>Explanation 2:<br>key 0 - value 5<br>key 1<br>key 2 - valuе 5xбх7 %3D 210<br>value 5+6 = 11<br>II<br>II<br>II<br>II<br>II<br>II<br>II<br>II<br>II<br>II<br>II<br>II<br>II<br>II<br>II<br>II<br>II<br>

Extracted text: Write a Python program that takes a string as an input where multiple numbers are separated by hashes(#). Your first task is to create a list of numbers and print it. Your second task is to create a dictionary that will have the index of the list as key, and for the even indices, multiplication from start to that index as value, while for the odd indices, summation from start to that index as value. Finally, print the dictionary. Sample Input 1: 1#2#3#4 Sample Output 1: [1, 2, 3, 4] {0: 1, 1: 3, 2: 6, 3: 10} Explanation 1: key 0 key 1 key 2 key 3 value 1 value 1+2 = 3 value 1x2x3 = 6 value 1+2+3+4 = 10 Sample Input 2: 5#6#7 Sample Output 2: [5, 6, 7] {0: 5, 1:11, 2: 210} Explanation 2: key 0 - value 5 key 1 key 2 - valuе 5xбх7 %3D 210 value 5+6 = 11 II II II II II II II II II II II II II II II II II

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here