Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q/ using python answer the follwing parts : Part 1 For this part of the lab, write code to iterate over all multiples of 3

Q/ using python answer the follwing parts :

image text in transcribed

Part 1 For this part of the lab, write code to iterate over all multiples of 3 between 0 and 100 (inclusive), and print the ones that are divisible by 2. Use the range() function to obtain a list of multiples of 3 between 0 and 100. Note: To determine if a number is divisible by 2, use the modulus operator (%) which returns the remainder after dividing two numbers. For example: >>> 100 % 10 >>> 97 % 1 7 Part 2 For this part of the lab, write code to check to see if an element, stored in a variable toFind, exists somewhere in the list. Print out the index of the element, if it exists in the list, and the message "The element does not exist in the list," otherwise

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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions