Given the user inputs, complete a program that does the following tasks: Define a set, fruits, containing the user inputs: my_fruit1, my_fruit2, and my_fruit3. Add the user inputs, your_fruit1 and your_fruit2, to fruits. Add the user input, their_fruit, to fruits. Add your_fruit1 to fruits. Remove my_fruit1 from fruits. Observe the output of each print statement carefully to understand what was done by each task of the program. Note: For testing purposes, sets are printed using sorted() for comparison, as in the book's examples. Ex: If the input is:

Answers

Answer 1

The program is an illustration of sets in a python program

What are sets?

Sets are variables that hold multiple values in a program

The main program

The program written in Python, where comments are used to explain each line is as follows:

my_fruit1 = input()

my_fruit2 = input()

my_fruit3 = input()

your_fruit1 = input()

your_fruit2 = input()

their_fruit = input()

# 1. TODO: Define a set, fruits, containing my_fruit1, my_fruit2, and my_fruit3

fruits = {my_fruit1, my_fruit2, my_fruit3}

print(sorted(fruits))

# 2. TODO: Add your_fruit1 and your_fruit2 to fruits

fruits.add(your_fruit1)

fruits.add(your_fruit2)

print(sorted(fruits))

# 3. TODO: Add their_fruit to fruits

fruits.add(their_fruit)

print(sorted(fruits))

# 4. TODO: Add your_fruit1 to fruits

fruits.add(your_fruit1)

print(sorted(fruits))

# 5. TODO: Remove my_fruit1 from fruits

fruits.remove(my_fruit1)

print(sorted(fruits))

Read more about python programs at:

https://brainly.com/question/26497128


Related Questions

In the code segment below, assume that the ArrayList object numbers has been properly declared and initialized to contain [0, 2, 4, 5]. for (int k = numbers.size() - 1; k >= 0; k--) { if (numbers.get(k) > k) { System.out.print(k + " "); } } What, if anything, is printed as a result of executing the code segment?

Answers

Answer:

Result: C The output that will be printed will be:  3 2 1 If the program is executed, the loop runs in reverse. So it runs from 3 to 0. In the first iteration: at index 3 the corresponding number is 5, so since 5 is greater than present value of k.

A software repository, also known as a 'repo', is:

Answers

Answer:

A software repository, or “repo” for short, is a storage location for software packages.

A game is played by moving a game piece left or right along a horizontal game board. The board consists of spaces of various colors, as shown. The circle represents the initial location of the game piece.

Yellow Black Green Green Red Yellow Black Black Yellow Black

The following algorithm indicates how the game is played. The game continues until the game is either won by landing on the red space or lost when the piece moves off either end of the board.

Step 1: Place a game piece on a space that is not red and set a counter to 0.
Step 2: If the game piece is on a yellow space, move the game piece 3 positions to the left and go to step 3. Otherwise, if the game piece is on a black space, move the game piece 1 position to the left and go to step 3. Otherwise, if the game piece is on a green space, move the game piece 2 positions to the right and go to step 3.
Step 3: Increase the value of the counter by 1.
Step 4: If game piece is on the red space or moved off the end of the game board, the game is complete. Otherwise, go back to step 2. If a game is begun by placing the game piece on the rightmost black space for step 1, what will be the value of the counter at the end of the game

Required:
If game piece is on the red space or moved off the end of the game board, the game is complete. Otherwise, go back to step 2. If a game is begun by placing the game piece on the rightmost black space for step 1, what will be the value of the counter at the end of the game?

Answers

The value of the counter of the given algorithm at the end of the game is; 4

How to solve Algorithms?

From the attached table, we see the algorithm of the given game.

Now, the black circle is initially under the column black.

From the given conditions, step 1 says since the space is not red we should set a counter to 0. Thus, the counter will be set to 0.

Since the game piece is under the black column, according to step 2, we will move the game piece 1 position to the left and go to step 3.

By moving one position to the left, the game piece will be under the yellow column. We now increase the counter by 1 to 1.

According to step 2, at yellow, we move the game piece 3 places to the left and it will land on yellow and we increase the counter to 2 and move 3 places to the left again to stop at green.

At green we increase the counter to 3 and then move two spaces to the left which is the left end of the board and we will increase the counter to 4 and the game will be complete according to step 4.

Read more about Solving Algorithms at; https://brainly.com/question/24793921

Excel 365 is primarily used to produce Word documents.

Answers

If this is a true and false question it would be False

Excel 365 is primarily used to produce Word documents is a false statement.

What is Microsoft Word and Excel meant for?

Microsoft Word is known to be a kind of word processing software that is often used for writing letters, memos, reports and others.

The Microsoft Excel is known to be a spreadsheet software that is meant to be used for calculations, creating charts and recording data about any  business processes.

Conclusively, Excel 365 is primarily used to produce calculations and not word document.

Learn more about Excel from

https://brainly.com/question/25879801

Described the importance of developing strategies to conduct educational research.

Answers

Step 1: Identifying a Problem.

2

Step 2: Reviewing the Literature.

3

Step 3: Specifying a Purpose and Research Questions. Writing purpose statements, research questions, and hypotheses provide critical direction to an educational research study. ...

4

Step 4: Designing a Study.

ecu

Write the program of while loop .

Answers

Answer:#include<stdio.h>  

int main(){    

int i=1;      

while(i<=10){      

printf("%d \n",i);      

i++;      

}  

return 0;  

}    

Explanation:

This is the program I coded on the while loop.

In this exercise we have to use the knowledge of programming in C code  to describe a looping so we have the code.

The code can be found in the attached image.

How to repeat code in C?

Repeat commands are a feature that allows a certain piece of code in a program to be repeated a certain number of times. In C there are three repetition commands: while, do-while and for.

So in a simpler way the code is:

#include<stdio.h>  

int main(){    

int i=1;  

while(i<=10){    

printf("%d \n",i);    

i++;    

}  

return 0;  

}    

See more about C code at brainly.com/question/25870717

"A document stored on web server and is available on the web is called web page" TRUE OR FALSE​

Answers

Answer:

true .................

What does the x mean in .docx

Answers

Answer:

When Microsoft switched to XML-based file formats in Office 2007, they added the 'x' to the file extensions to differentiate from the previous, incompatible formats such as dox to docx.

In other words. X is extended.

what is the longest word that you can write using the letters only on one row of the keyboard of your computer?

Answers

Answer:

TYPEWRITER is the longest word that you can write using the letters only on one row of your computer's keyboard.

Explanation:

hope this helps

Help your professor to calculate the exam average and the number of students passing the course by writing a maria program. The program will take as input the number of exam papers and the exam points for each student. At the and show the class average and the number of students passing the course. Note that the passing grade is 60.

Answers

#include <iostream>

using namespace std;

int main ()

{

int num =0 ;

int points=0 ;

int pointss=0;

int term =0;

int passes =0;

cout<<"type number of "<<endl;

cin>> num;

for(int i =0;i<num;i++)

{

cout<<"type points "<<endl;

cin>>points;

pointss=points + pointss;

if(points>=60)

{

passes++;

}

}

cout<<"that are points: "<<endl;

cout<<pointss<<endl;

cout<<"that is num: "<<endl;

cout<<num<<endl;

cout<<"average: "<<endl;

cout<<pointss/num<<endl;

cout<<"Number of students who pass: "<<endl;

cout<<passes<<endl;

return 0;

}

explain 3 advantages and 3 disadvantages of computers ​

Answers

Answer:

advantage

1: finish tedious tasks faster (writing an essay)

2: the internet (you can learn anything)

3: reduces the use of paper

disadvantage

1: social media (being addictive toxic)

2: decreasing jobs

3: less time for people to interact in person

Explanation:

hiya!!!

advantages:

1. computers make information more accessible
2. they help pass time
3. they store documents and data

disadvantages:

1. information can get leaked
2. costly
3. uses up electricity

4. The is the metal box that contains the main components of the computer ​

Answers

Answer:

The computer case

Explanation:

"The computer case is the metal and plastic box that contains the main components of the computer, including the motherboard, central processing unit (CPU), and power supply. The front of the case usually has an On/Off button and one or more optical drives."

Computer always produces wrong output true or false

Answers

Answer: You really need a screenshot here. That's it

Explanation: I can't give a definitive answer without a screenshot, lol

1. (A) What do you mean by computer? Discuss the use of
computer in daily life.

Answers

Answer:

A computer is an electronic device that manipulates information or data.

We use computers in schools and colleges all around the world.

Computer technologies are important to teach students digitally and creatively with data visualization. In a classroom, students used computers to explore their creativity and imagination.

Answer:

an electronic device for storing and processing data, typically in binary form, according to instructions given to it in a variable program.

Some people use a computer to take online classes.Computers have many other uses at home like financial calculations also. You can also access banking and business services from home via the internet with the help of a computer.

2 What is the different between mouse and trackbeel?​

Answers

Answer:

Trackball and Mouse is that trackball is a stationary pointing device with a ball on its top or side. While mouse is a pointing device that fits comfortably under the palm of your hand. With a mouse, users control the movement of the pointer.

Explanation:

I hope this helps!

Answer:

mouse moves by using a sensor to see how far the mouse has moved in real time and give the input to the computer. and a trackball uses sensors to see how far the ball has moved and give the input to the computer

Explanation:

What module do you need to import in order to use a pseudo-random number in your game?

A. randomizer
B. guess
C. guesser
D. random

Answers

D: Random I don’t think the others are even valid python Libs

By using the radiant method from the random module and need to import in order to use a pseudo-random number in your game.

What is randint method?

The randint() method is a method or function in the random python module. It is used to get or return an integer number within a specified range.

To use the method, the module must be imported into the python file with the "import random" statement, then the method is referenced using dot notation and specifying the range of integer numbers. Syntax: random. randint first_number, last_number note that the last number in the range is inclusive in the selection.

Random numbers refers to a set of unbiased numbers formed within a defined set of interval. Random number generation using programming paradigm are done using the random module and not the math module.

Therefore, By using the radiant method from the random module and need to import in order to use a pseudo-random number in your game.

Learn more about radiant method on:

https://brainly.com/question/29102331

#SPJ2

4. What organization is responsible for publishing Request for Comments (RFC)?

Answers

Answer:

IETF

Explanation:

The Internet Engineering Task Force.

What are some ways that an extremely large group of processors could be maintained?

Answers

The extremely large group of processors could be maintained from the manufacturer industry by an installation of a very good cooling system.

What challenges does processors pose?

Despite the capability of modern processor, the heating system presented a major challenge for the system because it might shut down the system on the thermostat observed the processor is emitting alarming heat.

In conclusion, the extremely large group of processors could be maintained from the manufacturer industry by an installation of a very good cooling system.

Read more about computer processors

brainly.com/question/614196

Modify the FitnessTracker class, created in Chapter 4 Programming Exercise 3AB, so that the default constructor calls the three-parameter constructor. Use TestFitnessTracker2 to test the new version of the class.

FitnessTracker2.java:
import java.time.*;
public class FitnessTracker2 {
String activity;
int minutes;
LocalDate date;
public FitnessTracker2() {
}
public FitnessTracker2(String activityParam, int minutesParam, LocalDate dateParam) {
}
public String getActivity() {
}
public int getMinutes() {
}
public LocalDate getDate() {
}
}

TestFitnessTracker2.java:
import java.time.*;
public class TestFitnessTracker2
{
public static void main(String[] args)
{
FitnessTracker2 exercise = new FitnessTracker2();

System.out.println(exercise.getActivity() + " " + exercise.getMinutes() +
" minutes on " + exercise.getDate());

// code to test constructor added for exercise 3b

LocalDate date = LocalDate.of(2020, 8, 20);
FitnessTracker2 exercise2 = new FitnessTracker2("bicycling", 35, date);

System.out.println(exercise2.getActivity() + " " + exercise2.getMinutes() +
" minutes on " + exercise2.getDate());
}
}

Answers

Answer:

Is this coding?

Explanation:

examples of a computer organizing itself

Answers

I don’t think if there is one that can do that only softwares

Question 1
Which of the following is a software threat?
a
O A) session hijacking
OB) overflow attack
OC) cross-site scripting (XSS)
OD) hacking

Answers

well we can rule out session as this is a threat to the computer not the software

next let's talk about overflow attack as this can be used on any software that has connecten to the internet

cross site scripting is for websites only as it involves loading code on to a website

and hacking if a very broad term so I would rule that out also

so I believe the answer is b

hope I helped

scav

The one that is software threat is an overflow attack. The correct option is b.

What is a software threat?

Software threats are harmful programs and pieces of code that can harm your computer and steal your personal or financial data. Because of this, these harmful programs are frequently referred to as malware (short for "malicious software").

Nowadays, many software vulnerabilities explicitly target smartphones, making cybersecurity strategies based on desktop PCs ineffective in some cases.

Apps, and smartphone viruses, are merely mobile versions of viruses that target your desktop or laptop computer. Blue jacking is the practice of sending unwanted or unsolicited Bluetooth messages to complete strangers.

Therefore, the correct option is b, overflow attack.

To learn more about software threats, refer to the below link:

https://brainly.com/question/28048202

#SPJ2

hello everyone I need some help with what a footer is on a web page

Answers

Answer:

A website's footer is an area located at the bottom of every page on a website, below the main body content

Explanation:

By including a footer, you make it easy for site visitors to keep exploring without forcing them to scroll back up.

Identify science and technology policies that could be adapted or implemented in the Philippines?​

Answers

Answer:

In the Philippines, universities dominate the research arena. So you have scientists who make research for the sake of research.

The private sector may or may not adopt the research. If a research in UP finds a molecule that may kill cancer, we are not sure whether that research will be adopted or not.

We are not sure if that research will be continued to actual creation of a medicine of cancer. This is because our scientists are working in universities and not in actual pharma companies.

In other countries, the scientists build their own companies. So their research go from drug development to actual manufacturing and marketing of medicines.

So when they start a research, you know that in the next 5 to 10 years, these scientists will produce drugs which the public can benefit from.

This is why the Philippine research is not thriving as it should. Our government should support our start ups.

When scientists are given grants for research, they should also be given grants to start their company. Unfortunately, start up grant is not a function of the DOST. It is of the DTI.    

Explanation:

In the Philippines, universities dominate the research arena. So you have scientists who make research for the sake of research.

Which sector does not adopt research?

The private sector may or may not adopt the research. If a research in UP finds a molecule that may kill cancer, we are not sure whether that research will be adopted or not.

We are not sure if that research will be continued to actual creation of a medicine of cancer. This is because our scientists are working in universities and not in actual pharma companies.

In other countries, the scientists build their own companies. So their research go from drug development to actual manufacturing and marketing of medicines. So when they start a research, you know that in the next 5 to 10 years, these scientists will produce drugs which the public can benefit from.

This is why the Philippine research is not thriving as it should. Our government should support our start ups. When scientists are given grants for research, they should also be given grants to start their company. Unfortunately, start up grant is not a function of the dust. It is of the DTI.  

Therefore, In the Philippines, universities dominate the research arena. So you have scientists who make research for the sake of research.

Learn more about Philippine on:

https://brainly.com/question/26599508

#SPJ2

 

A(n) _____ is a network connection device that can build tables that identify addresses on each network. Group of answer choices switch adapter card dynamic router hub

Answers

A network connection device that is designed and developed to build tables that identify IP addresses on each network is called a: C. dynamic router.

What is a dynamic router?

A dynamic router can be defined as a network connection device that is designed and developed to use adaptive routing in creating or building tables that identify IP addresses on each network.

An adaptive routing is also referred to as dynamic routing and it refers to a network protocol that allows optimal data routing by selecting paths using complex routing algorithms, according to real time routing table changes in a dynamic router.

Read more on dynamic router here: https://brainly.com/question/24812743

In the context of the data administration component of a database management system (DBMS), the acronym CRUD stands for _____. Group of answer choices create, read, update, and delete copy, revise, undo, and define create, repeat, undo, and develop copy, read, update, and define

Answers

Answer:

C.R.U.D stands for Create, Read, Update, Delete.

Explanation:

Python problem: The program needs to output the numbers 1 to 9, each on a separate line, followed by a dot:

Answers

Answer:

for i in range(1,10): print("{}.".format(i))

Explanation:

here's a one liner that does what you need.

(C) Describe about the different types of computer
peripherals and memory devices.

Answers

Computer peripheral device

Monitor.

Monitor. Keyboard.

Monitor. Keyboard. Mouse.

Monitor. Keyboard. Mouse. Trackball.

Monitor. Keyboard. Mouse. Trackball. Touchpad.

Monitor. Keyboard. Mouse. Trackball. Touchpad. Pointing stick.

Monitor. Keyboard. Mouse. Trackball. Touchpad. Pointing stick. Joystick.

Monitor. Keyboard. Mouse. Trackball. Touchpad. Pointing stick. Joystick. Light pen.

MEMORY DEVICES :

The main storage is the primary memory, and data and programs are stored in secondary memory. However, memory is not stored in the CPU, but the CPU would only be a mess of wires without it!

RAM (Random Access Memory) and ROM (Read Only Memory) are examples of primary storage. Secondary Storage Devices: Secondary storage is a memory that is stored external to the computer. ... Hard Disk, CD, DVD, Pen/Flash drive, SSD, etc, are examples of secondary storage.

Thus, Computer storage is of two types: ... RAM (Random Access Memory) and ROM (Read Only Memory) are examples of primary storage. Secondary Storage Devices: Secondary storage is a memory that is stored external to the computer. It is mainly used for the permanent and long-term storage of programs and data.

We call any device connected to the Internet a(n) ________. Group of answer choices router host IP client

Answers

Answer:

ADSL modem

Explanation:

What is the controller in this image know as? Choose one

Answers

Answer:

mode dial

Explanation:

The diagram shows the positions of the Sun, Earth, and Moon during each moon phase. When viewed from Earth, at what point does the Moon appear darkest?

Answers

Answer:

B

Explanation:

when it is on the same side of Earth as the Sun because it appears all black because of the shadow

Other Questions
3 Combine items from the columns to write statements about what is going to happen.yothablar por telfonocaminar en el parqueestudiar en la bibliotecaClaudiair air al restauranteUd.los profesorestomar el autobsMara y yoir en bicicleta por el parque1.2. one example of requirement verification techniques Using a calculator would NOT be considered integral to physical activity? A 2-yard piece of linen cost $34.48 what is the cost per foot helpp plsss right now Which of the following expressions represents the perimeter of the figure below?Group of answer choicesA. 5x - 10B. 5x -6C. 10x - 12D. 10x - 20 Professors will likely expect you to read the textbook before class, take notes during class, and study between classes. These expectations are unwritten assumptions, which sociologists refer to as: Unreasonable expectations Group norms Hidden rules Primary roles hello help me with this question thanks in advance What type of ion channels in the membrane of neurons open or close in response to a neurotransmitter binding to its receptor A biology class has 29 students. Find the probability that at least two students in the class have the same birthday. For simplicity, assume that there are always 365 days in a year and that birth rates are constant throughout the year. (Hint: First, determine the probability that no 2 students have the same birthday and then apply the complementation rule.) Select the correct answer.Katya thinks the lunch break policy at her office needs to change. She feels the current time given for lunch, which is 30 minutes, doesnt allow employees time to go out of the office to eat lunch. Shes writing a proposal to send to her boss. Which sentence best describes the objective of her proposal?A. Other workplaces have a lunch break that extends to 60 minutes, which allows employees to travel to nearby cafs or restaurants to eat.B. The lunch break policy for employees is supposed to give employees the chance to rest and eat their lunch before returning to work.C. The intent is to review the lunch break policy and suggest ways to accommodate the needs of employees who eat lunch outside the office.D. Employee productivity will certainly increase if employees get a 60-minute lunch break each day, which will benefit the company. Choisissez dans la liste le bon mot ou la bonne expression pour complter chaque phrase.au rez-de-chaussel'hteliertout de suiteune clcompletneuvimeun litl'ascenseurson passeportune chambre individuelle1. Pour entrer dans une chambre, on a besoin d'______2. Quand on a une chambre au cinquime tage, il est normal de prendre ______3. La rception est en gnral ____4. Dans chaque chambre, il y a une fentre avec balcon (balcony), un bureau et ______5. L'htel est _____ il faut chercher un autre endroit pour dormir..6.______ c'est la personne qui travaille la rception d'un htel.7. Pour rserver une chambre, il faut quelquefois montrer ___ l'htelier8. Quand on voyage seul, il est normal de rserver ___ Henry correctly factored 4x^(2)+5x-6 as (4x-3)(x+2). He then claimed that the zeros of that quadratic function are located at x=-(1)/(2) and x=2. Did Henry correctly find the zeros of the function? How did political machines gain power in the late 19th and early 20th centuries?. I WILL GIVE BRAINLY TO WHOEVER GETS THIS RIGHT PLAESE HELPPP. LOOK AT THE PICTURE. Jorden has 28 golf balls. Of the 28 golf balls 1/7 are yellow. How many balls are yellow? can someone please help me with this How many solutions does the following equation have? 5 x + 8 7 x = 4 x + 1 5x+87x=4x+15, x, plus, 8, minus, 7, x, equals, minus, 4, x, plus, 1 Choose 1 answer: Choose 1 answer: (Choice A) A No solutions (Choice B) B Exactly one solution (Choice C) C Infinitely many solutions Formula for trapezium? HelpHow do you find the sum of the exterior angle measures of any convex polygon?If the polygon is regular, how do you find the measure of each exterior angle in the polygon?