

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Homework 5
30], (5, 15, 25)). Expected output: 20 b) Remove an empty tuple(s) from a list of tuples. Sample data: [(), (), ('',), ('a', 'b'), ('a', 'b', 'c'), ('d')]. Expected output: [('',), ('a', 'b'), ('a', 'b', 'c'), 'd'] c) Modify the first item (22) of a list inside a following tuple to 222 tuple1 = (11, [22, 33], 44, 55). Expected output: tuple1 = (11, [222, 33], 44, 55)
sampleSet = {"Yellow", "Orange", "Black"} sampleList = ["Blue", "Green", "Red"] Expected output: In set item order is not a concern {'Green', 'Yellow', 'Black', 'Orange', 'Red', 'Blue'} b) Remove 10, 20, 30 elements from a following set at once set1 = {10, 20, 30, 40, 50} Expected output: {40, 50}
set1 = {10, 20, 30, 40, 50} set2 = {30, 40, 50, 60, 70} Expected output: a) {40, 50, 30} b) {70, 40, 10, 50, 20, 60, 30} c) {10,20} d) {10,20,60,70}
Machine learning; (ML) is the study of \ computer algorithms that improve automatically through# experience. It is seen as a subset of artificial intelligence. Machine learning algorithms build a mathematical model based on sample data, known as "training data", in order to make predictions or decisions without being explicitly programmed to do so. Machine{ learning} algorithms are used in a wide variety of applications, such as email filtering and computer() vision, where it is difficult or infeasible to develop conventional algorithms to perform the needed tasks. Machine# learning is closely related to computational *statistics, which focuses on making predictions! using computers. The study of mathematical optimization delivers methods, theory and application domains to the-- field ;of machine learning. Data mining is a related field of study, focusing on
exploratory data analysis through unsupervised learning In its application across business problems, machine learning is also referred to as predictive analytics. a) How many words are there in the message? b) How many different words are there in the message? c) Count the frequency of each word.
Each item on the list of customers contains the name, age, and the money that has to payed. a) Calculate the total amount the customer needs to pay (Same name and exact age are considered one customer). b) The following discount program is applied to celebrate National Day on September
Calculate the total amount to be paid for each customer (Gift = 2$).
“A(x,y)=2xy+4x+5y+x^2 - y^2- 5 ” a) How many variables? b) Enter the values of variables by the user and then calculus A(x,y) respective.