CODING TIME
1. Create a list of your favorite food items. (at least 7 elements). With the help of coding, illustrate the working of extend, append and insert functions.
2. Show the difference between remove and pop on a list of flowers.

Answers

Answer 1

Answer:

food_list = ['rice', 'beans','yam', 'bread', 'pasta', 'cocoa','tea']

one_more = ['meat']

extend_list = food_list + one_more

print(extend_list)

Output : ['rice', 'beans','yam', 'bread', 'pasta', 'cocoa','tea', 'meat']

food_list.append('milk')

print(food_list)

Output : ['rice', 'beans','yam', 'bread', 'pasta', 'cocoa','tea', 'milk']

food_list.insert(0, 'cake')

print(food_list)

Output : ['cake', 'rice', 'beans','yam', 'bread', 'pasta', 'cocoa','tea']

flowers = ['rose', 'hibiscus', 'lily']

flowers.remove('rose')

print(flowers)

Output : ['hibiscus', 'lily']

To remove rose using pop()

flowers.pop(0)

Explanation:

The + operator and append method adds elements to the end of an existing list item.

The insert method adds element at the specified index

Remove method deletes element by stating the name of the element to be deleted while pop deletes element using the index value of the element.


Related Questions

Lol lets make a new trend on here,
░░░░░█▐▓▓░████▄▄▄█▀▄▓▓▓▌█ Help
░░░░░▄█▌▀▄▓▓▄▄▄▄▀▀▀▄▓▓▓▓▓▌█ Doge
░░░▄█▀▀▄▓█▓▓▓▓▓▓▓▓▓▓▓▓▀░▓▌█ Take
░░█▀▄▓▓▓███▓▓▓███▓▓▓▄░░▄▓▐█▌ Over
░█▌▓▓▓▀▀▓▓▓▓███▓▓▓▓▓▓▓▄▀▓▓▐█ Brainly
▐█▐██▐░▄▓▓▓▓▓▀▄░▀▓▓▓▓▓▓▓▓▓▌█▌ Copy
█▌███▓▓▓▓▓▓▓▓▐░░▄▓▓███▓▓▓▄▀▐█ And
█▐█▓▀░░▀▓▓▓▓▓▓▓▓▓██████▓▓▓▓▐█ Paste
▌▓▄▌▀░▀░▐▀█▄▓▓██████████▓▓▓▌█▌
▌▓▓▓▄▄▀▀▓▓▓▀▓▓▓▓▓▓▓▓█▓█▓█▓▓▌█▌DO IT.
█▐▓▓▓▓▓▓▄▄▄▓▓▓▓▓▓█▓█▓█▓█▓▓▓▐

Answers

Answer: 9k

Explanation:

Answer:

LESSSSSSS GOOOOOOOOOOOOOOOOOOOO I will do the trend and give u credit too (can i have brainlest plz? :D )

Explanation:

Other Questions
how did this change in law affect southern plantation owners? do yall know this one? how was Parliament able to winthe Civil War brainliest for ripromano please anybody else dont answer Balance this equation. Not all spots have to have a number.____Na(s) + ____H2O(g) ____NaOH(s) + ____H2 (g) someone please answerrrrrr what is the distance between (-1, 2) and (5, -2)on a graph put into a decimal form. Which choice states the rhetorical appeal that the passage uses? The passage appeals to logos. The passage appeals to ethos. The passage appeals to pathos. The passage appeals to argument. A hot piece of copper is placed in water in an insulated cup. What is the finaltemperature of the water and copper?(Useme AT: + copperfcoppe, Acoppe: = 0]m = 0.50 kg water = 4.18 kJ/kg-'c,m.copper = 0.50 kg, Cropper = 0.386 kJ/kg-C, Ti copper = 115CTower = 22CO A. 30CB. 45CO C. 39CO D. 52C What is:a panel interviewa group interviewa formal interviewa informal interview which word is used incorrectly Most students think of Christopher Columbus as the first European tovisit North America. There is evidence, though, that other explorersvisited first. For example, in eastern Canada, researchers have foundproof of very early explorers from Iceland. It's a discovery with animportant affect on our understanding of history.A. ThereB. affectC. It'sD. proof On a sunny spring day, a student is playing on a game board painted on the concrete at a school playground. The student notices that an areapainted white is cooler than an area painted dark blue.Why is the white area cooler than the dark blue area?A. The white area has reflected more light energy than the dark blue area.B. The white area has absorbed more light energy than the dark blue area.C. The white area has radiated more infrared energy than the dark blue area.D. The white area has absorbed more infrared energy than the dark blue area. Name the two extremists according to MLK Jr. 10points 4x + 5y = 227x - 3y = -32 The price listed for 4 dinner plates at a home store is $23.88. What amount will Jane need to pay, if she decides to purchase 10 such dinner plates? 9) 8.081 ++ 0.6 = 10.20110)- 3.328 = 0.96 I need help understanding how to solve an equation like this I'm struggling bad help me pls!!!! :c rip 1.The splitting of a heavy, unstable nucleus into two lighter nuclei is called _____.a. Fissionb. Fusionc. Radioactive Decayd. Isotopes Sydney simplifies the expression 2csc(-y) with the work below. What did she do wrong? 2csc(x+y)= 2/sin(x-y)=2/cos x cos(-y)+sin xsin(-y) =2/cos x cos y - sin xsin y =2/cos( x +y) = 2 sec (x + y)