3.10 LAB: List basics
Given the user inputs, complete a program that does the following tasks:

Define a list, my_list, containing the user inputs: my_flower1, my_flower2, and my_flower3 in the same order.
Define a list, your_list, containing the user inputs, your_flower1 and your_flower2, in the same order.
Define a list, our_list, by concatenating my_list and your_list.
Append the user input, their_flower, to the end of our_list.
Replace my_flower2 in our_list with their_flower.
Remove the first occurrence of their_flower from our_list without using index().
Remove the second element of our_list.
Observe the output of each print statement carefully to understand what was done by each task of the program.

Ex: If the input is:

rose
peony
lily
rose
daisy
aster
the output is:

['rose', 'peony', 'lily', 'rose', 'daisy']
['rose', 'peony', 'lily', 'rose', 'daisy', 'aster']
['rose', 'aster', 'lily', 'rose', 'daisy', 'aster']
['rose', 'lily', 'rose', 'daisy', 'aster']
['rose', 'rose', 'daisy', 'aster']

Answers

Answer 1

The program is an illustration of Python lists; lists are used to hold multiple values in a variable

The main program

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

#This gets all required outputs

my_flower1 = input(); my_flower2 = input(); my_flower3 = input(); your_flower1 = input(); your_flower2 = input(); their_flower = input()

# This defines my_list and appends the values of my_flower1, my_flower2, and my_flower3

my_list=[my_flower1,my_flower2,my_flower3]

# This defines your_list and appends your_flower1 and your_flower2

your_list=[your_flower1,your_flower2]

# This defines our_list by and concatenates my_list and your_list

our_list = my_list+your_list

#This prints our_list

print(our_list)

# This appends their_flower to the end of our_list

our_list.append(their_flower)

#This prints our_list

print(our_list)

# This replaces my_flower2 in our_list with their_flower

our_list[our_list.index(my_flower2)]=their_flower

#This prints our_list

print(our_list)

#This removes the first occurrence of their_flower from our_list

our_list.remove(their_flower)

#This prints our_list

print(our_list)

#This removes the second element of our_list

our_list.remove(our_list[1])

#This prints our_list

print(our_list)

Read more about python lists at:

https://brainly.com/question/16397886


Related Questions

positive and negative of adblock plus

Answers

Answer:

Pros and cons of ad blockers

Remove distracting ads, making pages easier to read.

Make web pages load faster.

Keep advertisers from tracking you across websites.

Reduce bandwidth (especially important with mobile devices)

Reduce battery usage (again, important for mobile devices)

p

9.12: Element Shifter
Write a function that accepts an int array and the array’s size as arguments. The function should create a new array that is one element larger than the argument array. The first element of the new array should be set to 0. Element 0 of the argument array should be copied to element 1 of the new array, element 1 of the argument array should be copied to element 2 of the new array, and so forth. The function should return a pointer to the new array. Demonstrate the function by using it in a main program that reads an integer N (that is not more than 50) from standard input and then reads N integers from a file named data into an array. The program then passes the array to your element shifter function, and prints the values of the new expanded and shifted array on standard output, one value per line. You may assume that the file data has at least N values.

Prompts And Output Labels. There are no prompts for the integer and no labels for the reversed array that is printed out.

Input Validation. If the integer read in from standard input exceeds 50 or is less than 0 the program terminates silently.

Answers

The Element shifter program illustrates the use of functions and arrays

Arrays are used to hold multiple valuesFunctions are used as subroutines of a program

The Element shifter program

The Element shifter program written in C++, where comments are used to explain each action is as follows:

#include <iostream>

using namespace std;

//This declares the ElementShifter function

int* ElementShifter(int *arr, int size){

   //This declares the new array

   int *newArr = new int[size * 2];

//The following loop populates the new array

   for (int i = 0; i < size * 2; i++) {

       if(i == 0){

           *(newArr+i) = 0;

       }

       else if(i < size+1){

           *(newArr+i) = *(arr+i-1);

       }

       else{

           *(newArr+i) = 0;

       }

   }

//This returns a pointer to the new array

   return newArr;

}

//The main method begins here

int main(){

//This declares and gets input for N

   int N;    cin>>N;

   int myArr[N];

//If N is between 1 and 50

   if(N > 0 && N <=50){

//This populates the array

       for(int i = 0; i<N; i++){

           cin>>myArr[i];

       }

//This calls the Element shifter function

   int *ptr = ElementShifter(myArr, N);

//This prints the new array

   for (int i = 0; i < N*2; i++) {

       cout << ptr[i] << " ";

   }

   }

  return 0;

}

Read more abou C++ programs at:

https://brainly.com/question/27246607

what is the future of web development

Answers

Answer:

Creating websites that can execute automated tasks and new programing languages revolving around web development.

Explanation:

how to Develop Administrative Assistant Skills

Answers

Answer:

Multitasking, Flexible and resourceful.

Explanation:

im not sure what your asking for but to be or i dont now how to explain to good but hope you get what im mean it no brainier

These are raised as livestock for meat and milk EXCEPT one
A. Hog
B. Goat
C. Carabao
D. Cattle

Answers

The livestock that is not raised for  meat and milk is  hog.

What are animals raised for meat?

Livestock are known to be some domesticated animals that are said to be raised in an agricultural farm to give labor and produce things such as meat, eggs, milk, etc.

The animals that are raised for their meat and milk are:

Boar BroilerCattle, etc.

Learn more about animals from

https://brainly.com/question/25897306

20) Which of the following functions would take the word "Joe" (found in column A) and "Smith" (found in column B), and display "Joe Smith" in column C?

A. COMBINETEXT


B. TEXTJOIN


C. JOINTEXT


D. JOIN

Answers

Answer:

TEXTJOIN

Explanation:

TEXTJOIN is a common function of Ms Excel or Microsoft Excel

This function requires three arguments

delimiterignore_empty text1.

Answer:

TextJoin

Explanation:

Is the functions would take the word "Joe" (found in column A) and "Smith" (found in column B), and display "Joe Smith" in column C.

12.2 E-Z LOAN
A loan obtained from a lending institution is typically paid off over time using equal monthly payments over a term of many months. For each payment, a portion goes toward interest and the remaining amount is deducted from the balance. This process is repeated until the balance is zero. Interest is calculated by multiplying the current balance by the monthly interest rate, which is usually expressed in terms of an Annual Percentage Rate (APR). This process produces an Amortization Schedule where the amount applied to interest is gradually reduced each month and the amount applied to the balance grows. For example, the following amortization schedule is for a loan of $ 10.000 at an APR of 3.9% over a term of 30 months:3 will match months 12, 24, and 30 respectively.

Answers

Following an amortization schedule, the monthly payments will be $350.39 and the total payment in 30 months will be $10511.7.

How much should be paid monthly to complete loan payment in 30 months?

The loan payment follows an amortization schedule where the amount applied to interest is gradually reduced each month and the amount applied to the balance grows.

The amounts to be paid is calculated using the amortization formula:

P = a ÷ {{[(1 + r/n)^nt] - 1} ÷ [r/n(1 + r/n)^nt]}

where

P is monthly paymenta is credit amountr is the interest ratet is the time in yearsn is number of times the interest is compounded

For the loan of $10000;

a = $10000r = 3.9% = 0.039nt = 30 months

Hence,

P = $10000 ÷ {{[(1 + 0.039/12)^60] - 1} ÷ [0.039/12(1 + 0.0.039/12)^60]}

P = $350.39 per month

Total payment in 30 months = $350.39 × 30 = $10511.7

Therefore, the monthly payments will be $350.39 and the total payment in 30 months will be $10511.7.

Learn more about amortization schedule at: https://brainly.com/question/26433770

How many intrusion switches are there in Dell Precision Tower 7920?

Answers

The number of  intrusion switches in Dell Precision Tower 7920 is one.

What is an intrusion switch?

There is an chassis intrusion switch that is often used in the detection of any unauthorized access that is found stepping into the interior of one's system.

This kind of switch is known to be often activated quickly when the system cover is removed and access is done or made to the interior of one's system.

Learn more about intrusion switch from

https://brainly.com/question/24369537

what is the name of the extension used to save publisher

Answers

Answer:

PUB

Explanation:

PUB IS THE NAME OF THE EXTENSION USED TO SAVE PUBLISHER

The major goal of a good web information
a
retrieval system is

Answers

Answer:

Explanation:

The major objective of an information retrieval system is to retrieve the information – either the actual information or the documents containing the information – that fully or partially match the user's query.

What should I do instead of listen to music?

Answers

You could watch a movie
Learn something new that you are interested in

Steps of booting a computer

Answers

Steps of Booting
The Startup. It is the first step that involves switching the power ON. ...
BIOS: Power On Self Test. It is an initial test performed by the BIOS. ...
Loading of OS. In this step, the operating system is loaded into the main memory. ...
System Configuration. ...
Loading System Utilities. ...
User Authentication.

i need the full code for 6.1.3 code hs circles and squares please answer please help

Answers

In this exercise we have to use the knowledge in computational language in python  to write a code with circles and squares.

how to draw geometric figures in python?

inputs = 100

radius

   draw_circle(radius);

   pendown()

   begin_fill()

   circle(radius)

   end_fill()

   penup()

left(90)

forward(radius*2)

right(90)  

penup()

setposition(0,-200)

color("gray")

bottom_radius = int(input("What should the radius of the bottom circle be?: "))

draw_circle(bottom_radius)

draw_circle(bottom_radius)

See more about python at brainly.com/question/18502436

every CAD application comes with a color menu to help you tailor your selections, mix them properly, and apply them in ways that meet your artistic expectations

true or false

Answers

every CAD application comes with a color menu to help you tailor your selections, mix them properly, and apply them in ways that meet your artistic expectations is a true statement.

What is a color CAD?

In a CAD system, there is found to be colors that are known to be often and  most commonly used to depict line weights.

Note that selecting different colors is easy using varying line thickness. One can then use these colors into layers to smooth the visibility of drawing components that you wants.

Learn more about CAD application  from

https://brainly.com/question/9222927

Answer:true

Explanation:

Which evidence best addresses the counterclaim?

a story about a girl who becomes a professional athlete after she graduates
quotations from teens and parents who fight with coaches
a story about a boy who gets bad grades because he plays too many sports
an example of how sports may lead to many injuries


an exclamation point
an exclamation point

Answers

Answer:

A. a story about a girl who becomes a professional athlete after she graduates

Explanation:

i hope this helped

what is computers machain?

Answers

Answer:

the electronic device which take data process it and give meaningful results is called computer machine

I need help with these certain questions on my activities in school

Answers

Answer:

*part 3 multiple choice*

1 d. none of the above

2d. water

3 a. insulator

*The Other Part*

4. electrons change direction of flow frequency in ""alternating current""

2. conductors

Fumiko is a network technician. She is configuring rules on one of her company's externally facing firewalls. Her network has a host address range of 192.168.42.140-190. She wants to allow all hosts access to a certain port except for hosts 188, 189, and 190. What rule or rules must she write

Answers

The rule that she must write is that  A single rule allowing hosts 140–187 is all that is necessary; the default-deny rule takes care of blocking the remaining nonincluded hosts.

What is a Firewall?

A firewall is known to be a form of a network security device that helps one to manage, monitors and filters any form of incoming and outgoing network traffic.

This is often done based on an firm's formerly set up security policies. A  firewall is known as the barrier that exist between a private internal network and the public Internet.

See options below

What rule or rules must she write?

a) A single rule allowing hosts 140–187 is all that is necessary; the default-deny rule takes care of blocking the remaining nonincluded hosts.

b) Multiple rules are necessary for this configuration; one or more rules must define Deny exceptions for 188, 189, and 190, followed by the Allow rule for the 140–190 range.

c) A Deny rule is needed for 188, 189, and 190, and then exception rules for the 140–187 range.

d) The default Deny all rule needs to be placed first in the list, and then an exception rule for the 140–187 range.

Learn more about firewalls from

https://brainly.com/question/13693641

Text based game project 1

Answers

Answer:

What is your question?

Explanation:

One problem with backlighting is that your subject may squint.

True

False

Answers

Answer:

I would say that's False. Backlighting would be behind them. So they wouldn't need to squint.

Explanation:

which of the following is an example of application software

Answers

Answer:

A messaging app

Explanation:

Its an software application you can download, so...yeah.

(You might've thought it was an anti-virus program lol)

Option-D.A messaging app is the correct answer.
A messaging app is an application software that can be installed jn your phone and computer in order to send messages.

What is an Application software?Application software is a type of computer application that performs specific professional, academic, and individualized functions.Each software is designed to assist users with a variety of tasks, some of which may be related to productivity, creativity, or communication.Word processors, media players, and accounting software are examples of application programs.An application program (also known as a software application, application, or app for short) is a computer program created to carry out a specific task other than one related to the operation of the computer itself.The term "app" typically refers to apps for mobile devices such phones. Applications may be published independently or packaged with the computer and its operating system software.They may also be written in proprietary, open-source, or project code.An application can work with text, numbers, audio, visuals, and a combination of these depending on the task for which it was created.Word processing is an example of an application package that focuses on a particular task.On the other hand, integrated software merges several programs.

To learn about the DIfference between application software and Opertaing system click here-
https://brainly.com/question/17798901

#SPJ2

Write a function named count_vowels that accepts two arguments: a string and an empty dictionary. The function should count the number of times each vowel (the letters a, e, i, o, and u) appears in the string, and use the dictionary to store those counts. When the function ends, the dictionary should have exactly 5 elements. In each element, the key will be a vowel (lowercase) and the value will be the number of times the vowel appears in the string. For example, if the string argument is 'Now is the time', the function will store the following elements in the dictionary: 'a': 0 • 'e': 2 'i': 2 'o': 1 'u': 0 The function should not return a value.

Answers

The function that counts the number of times a vowel exist in a string is as follows:

def count_vowels(string, dictionary):

    vowels = 'aeiou'

    dictionary = {}.fromkeys(vowels, 0)

    for i in string:

         if i in vowels:

              dictionary[i] += 1

    return dictionary

print(count_vowels("trouble", {}))

Code explanation.

The code is written in python.

we defined a function named "count_vowels". The function accept a string and an empty dictionary.Then. we store the vowels in a variable vowels.The dictionary is used to store the key value pair i.e the vowels and the number of times they appear.We looped through the string.If any value in the string is in vowels,  we increase the dictionary values by 1.Then, we return the dictionary.Finally, we call the function with it parameters.

learn more on function here: https://brainly.com/question/27219031

Mike logged into a shopping website and entered his username and password. Which protocol will the website use to verify his credentials?

Answers

Answer:

I think it is email or password

Write a program that uses while loops to perform the following steps:
a. Prompt the user to input two positive integers. Variables: firstNum and secondNum
(firstNum must be less than secondNum) (use while loop); create a user-defined function
called validateUserInput() to validate the user's input. Use Call-by-Value.
validateUserInput() is a value returning function.

b. Output all odd numbers between firstNum and secondNum. (use while loop); create a
user-defined function called oddNumbers(). Use Call-by-Value. oddNumbers() is a void
function.

c. Output the sum of all even numbers between firstNum and secondNum. (use while
loop); create a user-defined function called sumEvenNumbers(). Use Call-by-Value.
Declare a variable called sumEven in the main() for the sumEvenNumbers().
sumEvenNumbers() is a valuereturning function. Use sumEven to hold a returned value.

d. Output the numbers and their squares between 1 and 10. (use while loop): create a
user-defined function called displaySquareNumbers(). Call-by-Value.
displaySquareNumbers() is a void function.

e. Output the sum of the square of the odd numbers between firstNum and secondNum.
(use while loop); create a user-defined function called sumSqureOddNumbers(). Use
Call-by-Value. Declare a variable called sumSquareOdd in the main(), for the

sumSqureOddNumbers(). sumSqureOddNumbers() is a value returning function. Use
sumSquareOdd to hold a returned value.

f. Output all uppercase letters. (use while loop); create a user-defined function called
displayUppercaseLetters(). Use Call-by-Value. displayUppercaseLetters() is a void
function.

Answers

The program is an illustration of the loop and functions

Loops are used to perform repetitive operationsFunctions are named code segments that ar executed when called or evoked

The main program

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

#This function validates the user input

def validateUserInput(firstNum, secondNum):

   if firstNum >= secondNum:

       return False

   return True

See attachment for the complete program

Read more about loops at:

https://brainly.com/question/19347842

nivel 1: operadores pedir 2 números al usuario y Sumarlos, restarlos, multiplicarlo y dividirlos ​

Answers

Answer:

¿Esta pregunta no tiene ningún sentido?

Explanation:

¿que estas pidiendo?

Which of the following are vector graphic file formats? Choose all that apply.

AI

PNG

RAW

SVG
Please help

Answers

There are different kinds of files. The option that is a vector graphic file formats is SVG.

What are vector files?

Vector files are known to be a type of images that are created by using mathematical formulas that stands as points on a grid.

The SVG  is known as Scalable Vector Graphics file and it is known to be a  vector image file format as it make use of geometric forms such as points, lines, etc.

Learn more about vector graphic file from

https://brainly.com/question/26960102

Answer:

AI and SVG

Explanation:

learned it from a comment i give all credit to them

what is containment and why is it part of the planning process

Answers

Answer:

Isolating affected channels, processes, services, or computers; stopping the losses; and regaining control of the affected systems. It is part of the planning process to identify the best containment option for each scenario or system affected.

Explanation:

What is a value which we pass to the function to use in place of the parameter when we call it?

A. Parameter
B. Call
C. Procedure
D. Argument

Answers

Answer:
D) Argument

Explanation:
When you call a function, you pass in an argument as the input to use in the place of the parameter.

explains why it is important to select the correct data when creating a chart

Answers

Answer:

to be organized

Explanation:

because when you are organized to select the correct data, you won't confused

a) Explain any two problems associated with the existing system used by the organization. (25 marks)​

Answers

Answer:

Lack of Strategy

Many of the most common MIS issues can be traced back to a lack of a solid strategy. Information systems leaders are well aware of the many tools available to gather data on their network. But putting that information to use is often a challenge.

At one time, technology departments served as a separate operation, providing tech support and keeping an organization’s server equipment running. Today, MIS leadership often sits alongside other business leaders, working together to ensure that the technology being used supports the overall mission of the company moving forward.

Meeting Organizational Needs

MIS plays an ever-increasing role in organizations, with professionals relying on technology for every aspect of operations. Sales and marketing rely heavily on customer relationship software to track client interactions, for instance, while accounting needs its own software for billing, invoicing and financial tracking.

With more than half of all companies now relying on big data analytics, MIS is playing an even more important role. Before making a decision, today’s management teams are likely to pull reports on existing activity to ensure they use facts rather than make educated guesses.

Explanation:

Other Questions
The purpose of the UCC is to make the lawstates.among the variousO A. uniformO B. understandableC. strictO D. different A triangle with exactly two sides of the same length is called your article should consist of 200-3200 words.it should contain at least two sentences you leave your house and drive 7 miles north, then turn left and drive 24 miles west. how far are you from your house? Suppose f(3) = 4. Name a point that must be on the graph of y=f(x)+4.Enter your answer as an ordered pair. Discuss the relationship between food and religion in Mesoamerica the tree diagram represents an experiment consisting two trials what are the feature of novel wuthering Heights? Here's a graph of a linear function. Write theequation that describes that function Express it in slope-intercept form. An atom is electrically neutral because(a) neutrons balance out the protons and electrons.(b) nuclear forces stabilize the charges.(c) the number of protons and electrons are equal.(d) the numbers of protons and neutrons are equal. Please helpI need help please show work!! which one is the missing symbol.4/5 ? 1/2A. >B. Which observation could lead to the conclusion that an object is nonliving? Which of the following wordsshares a word part - prefix, suffix,or root - with "impartial"?A. premadeB. partialityC. mantle After a product recall, a company solicits feedback from a random sample of 100 customers regarding their opinion about the company since the recall. Customers were asked, "Do you approve, disapprove, or have no opinion about the company? The public relations department is concerned that the opinions may be equally distributed across these three options. The survey reveals that 38 customers approve, 45 disapprove, and 17 have no opinion. They decide to carry out a test of significance to determine if there is convincing evidence that the distribution of opinion in the population is equally distributed across the three options. What is the value of the chi-square test statistic and the P-value of this test?Find the chi-square table here.2 = 7.77, P-value is between 0.02 and 0.0252 = 7.77, P-value is between 0.05 and 0.102 = 8.54, P-value is between 0.01 and 0.022 = 8.54, P-value is between 0.025 and 0.05 What is the value of n when 2/3 of n equals 42? Enter the answer in the box. The floor of Taylor's bathroom is covered with tiles in the shape of triangles. Each triangle has aheight of Zin and a base of 12 in. If the floor of her bathroom has 40 tiles, what is the area of thebathroom floor? Explain how the ruling of United States v. Richard Nixon, 1973 was an example of judicial review. Which branch of government did this ruling keep in check and how did it do so? What was the significane of the year 1850 in history? Find the volume of the cone.Use 3.14 for . Round your answer to the nearest tenth if needed. Do not enter units.