Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSCI 202 Spring 2022 Classwork 01-28-2022 Problem 1. Write Python function that will take as argument an integer number and compute and return a list

image text in transcribed

CSCI 202 Spring 2022 Classwork 01-28-2022 Problem 1. Write Python function that will take as argument an integer number and compute and return a list that contains those digits that are not in that number. For example, if the input number is 6524 the output list should be [0, 1, 3, 7, 8, 9] Problem 2. Write Python function that will take as an input a string and compute and return the list with the most frequent character(s) in that string. For example if the input is "mississippi, the output list should be ['s', 'i'] . On the other hand if the input is aardvark, the output should be ['a']. Consider lower case and upper case letter as different characters. Problem 3. Write Python function that takes as input a list of numbers and creates and returns a list of partial sums. That is, the first element in the output list should be the same as the first element in the input list, the second element in the output list should be equal to the sum of the first two elements from the input list, the third element in the output list should be equal to the sum of the first three elements in the input list and so on. Use list comprehension in your function. Problem 4. Write Python function that will take two parameters. The first parameter should be a list of numbers that is ordered and the second parameter should a single number. The function should modify the input list by inserting the second parameter number into that list but in such a way that the resulting list is still ordered. The function should not return anything just modify the input list. For example if the input list is [3, 6, 8, 10] and the number is 7, the list should change to [3, 5, 7, 8, 10]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions