This document contains 5 programming assignments: 1) Write a program to sum the digits of a number input by the user. 2) Write a program to calculate the factorial of each number in a list. 3) Write a program to remove duplicates from a list. 4) Write a program to create a 2D list of all zeros based on the number of rows and columns input by the user. 5) Write a program to multiply each element of a 2D list by a given number.
This document contains 5 programming assignments: 1) Write a program to sum the digits of a number input by the user. 2) Write a program to calculate the factorial of each number in a list. 3) Write a program to remove duplicates from a list. 4) Write a program to create a 2D list of all zeros based on the number of rows and columns input by the user. 5) Write a program to multiply each element of a 2D list by a given number.
This document contains 5 programming assignments: 1) Write a program to sum the digits of a number input by the user. 2) Write a program to calculate the factorial of each number in a list. 3) Write a program to remove duplicates from a list. 4) Write a program to create a 2D list of all zeros based on the number of rows and columns input by the user. 5) Write a program to multiply each element of a 2D list by a given number.
Roll #: Marks: 25 1. Write a program that will take a number as input from user and find the sum of the digits in the input number. Hint: The input is 120 so the function will add the digits like 1+2+0 = 3 and return 3. 2. Write a program that will find the factorial of all the number in a list. You code should be run any length of the list. Input: [2, 4, 5, 6, 8, 9] Output: [2, 24, 120, 720, 40320, 362880] 3. Write a program that will check the duplication in a list and it will return the list without duplication. Input: [6, 7, -2, 11, 7, -2] Output: [6, 7, -2, 11] 4. Write a program that will take the parameters of a (number of rows and columns). It will print the list which has rows and columns according to the given parameters and all the elements will be zero. Input: 3, 3 Output: [[0, 0, 0], [0, 0, 0], [0, 0, 0]] 5. You have to design a program that will take a 2D list and a number. Then it will multiple the input number with each element of the list.