Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 Copy the code below into your own repl. Do not change any of the code. ### 2 ltst1 = [48,46,19,18,41,1,19,47,30,40,35,12,26,33,31,43,44,1,50,37,40,31,4,1 7,3] 3 Ltst2 =

image text in transcribed
image text in transcribed
image text in transcribed
1 Copy the code below into your own repl. Do not change any of the code. ### 2 ltst1 = [48,46,19,18,41,1,19,47,30,40,35,12,26,33,31,43,44,1,50,37,40,31,4,1 7,3] 3 Ltst2 = [4,14,43,42,32,49,5,48,22,3,45,33,8,31,43,45,9,8,24,23,45,23,11,4,37 ] 5 \#A\# Start your own code below this line. \#\#N What your Python program should do Create a new repl for this lab. Do not reuse a repl from lecture activities. Copy the starter code into your own repl. Using Python code and logic, find which numbers appear in both 11 st 1 and 1 ist2. Put these numbers (that appear in both lists) into a third list called 1 ist 3 . Please see the clarifications section below. Print the contents of 1 ist 3 along with some helpful text for the user to know what's going on. Ask the user to enter the product name, the product's price as a decimal value with no dollar sign, and the product's current SKU. All of this information should be on one line. Separate each piece of information with a comma but no spaces. Please see the sample output below. Display this information to the user. Using your knowledge of Python, modify the entered information in the following ways: 1. Increase price by 10%. 2. Add "New=" to the product name. 3. Create a new SKU which is every third letter of the old SKU. Each letter in the new SKU must be capitalized. Display this new information to the user. Assumptions, clarifications, and hints - For every Python,assignment in this class, don't do anything "manually." For example, in this Lab, don't physically look at each number in 11 st 1 and 1 ist 2 and manually determine which numbers appear in both lists. Use Python code and design the logic so that the program does it for you. - You can assume the user will enter valid input as per the instructions. - Your program should be able to handle a decimal value for the price. - Get in the habit of using useful variable names (not x,y,z, etc.) so you can keep track of all the information you're working with. - It's ok to have duplicates in 11 st 3 . - Thinking in terms of math, how do you increase a number by 10% ? Figure out the math first before you transfer it to Python. - If you are already familiar with a programming language, please keep in mind that this is an intro course. We will not be using sets. Please only use lists. Duplicates in the list are ok. Sample output with Prof. Rich comments This is real output from my program. The text version below has my comments in normal font. Your output should match mine in terms of the information shown. Minor differences in formatting are ok. (1) Shell t Here are the numbers that appear in both lists [48,33,31,43,37,31,4,3] Please enter a price, product name, and product SKU, on one line, no spaces. Separate each field with a comma: 500, floss, makesureyoufloss 0ld product price: 500 old product name: floss old product SKU: makesureyoufloss New product price: 550.0 New product name: New-floss New product SKU: KUYFS Here are the numbers that appear in both 1 ists [48,33,31,43,37,31,4,3]] These numbers will be the same for everyone, every time you run your program, because we're all using the same starter code. To get the contents of the new list, l'm just doing print (1ist3). Please enter a price, product name, and product SKU, on one line, no spaces. Separate each fleld with a comma: 500 , floss, makesureyoufloss Remember that I'm not typing in "(space) 500... The space before the price is part of my input () helpful text. You don't need it; it's just for nicer formatting. The first line ('Please enter a price...") is just a print (). Every space after the colon in the new and old product information is also part of the print () (hint: the comma we learned about in class). Old product price: 500

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

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions

Question

=+You couldn't expect more from a cow, could you?

Answered: 1 week ago

Question

4. Did you rethink your decision?

Answered: 1 week ago

Question

3. Did you seek anyones advice?

Answered: 1 week ago

Question

7. What traps should she avoid?

Answered: 1 week ago