Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

It pizzas = ['cheese', 'pepperoni', 'marqherita', 'havailan', 'italian sausage', 'qreen poppers and' onions'] a) Using for statemeris and the method of lists called append, append

image text in transcribed
image text in transcribed
image text in transcribed
It pizzas = ['cheese', 'pepperoni', 'marqherita', 'havailan', 'italian sausage', 'qreen poppers and' onions'] a) Using for statemeris and the method of lists called append, append in the list lengths the length of each element in the pi zzas list, and print the list longths. 14 lengthe = [) A. YOUR CODE IIERE raise NotimplementedError() It b) Using for statements, the string method called capitalize and the mothod of lists called append, append in tho list plzzas_cap the capitallzed version of each olement in the pizzas list, and peint the list piraas_cap. 11 Pizzac cap =[1] Y YOUR CODE HERE raise NotimplementedError(1) c) Using for statements, the string method called f ind and the method of lists called append, append in the list loe _ t the incex of the first 'e' that appears in each element in the pizzan list, and print the list 100.0. Note: The find method will return - 1 if element is not tound. a) Write some code that extracts, from each word, all the letters excopt 'ball' at the end of each one. Save the output in a list named nod sports. and print it. \[ \text { 1: mod_sports }=\text { [] } \] * your coDe HERE raise Notimplementederror() a) Using for and if statements, Populate a list called numbers that will go from 0 up to 100 where, if the number is divisible by 3 and 5 , you replace it by the word "FizzBuzz; if the number is divisible by 3, you replace it by "Fizz"; and if the number is divisible by 5 , you replace it by "Buzz". All the remaining numbers should remain as numbers. Note: You have to use for statements and if statements together. Tips: - Look into the 8 operator. - To check if something is oqual to 0, remember you need to use the comparison operatoc. Note: After you finish, you can use the print statement to check your list. It numbers =[1 1. YOUR CODE HERE raise NotimplementedBrror()

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

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions