will appreciate a zoomed in screenshot of the code I could not see the figures clearly from my question I sent before. I had to send in the question again cause the first gave me a very blurry screentshoot of the code and solution on the paper was blank please dont send me a blank paper and zoom in clearly on the code even if it takes more than two screens hoots thanks. IN PYTHON PLEASE

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 16PE
icon
Related questions
Question
I will appreciate a zoomed in screenshot of the code I could not see the figures clearly from my question I sent before. I had to send in the question again cause the first gave me a very blurry screentshoot of the code and solution on the paper was blank please dont send me a blank paper and zoom in clearly on the code even if it takes more than two screens hoots thanks. IN PYTHON PLEASE
while (event-controlled) loop.
Sample output:
n >> 13
List: [1, 3, 3, 9, 5, 7, 8, 2, 10, 8, 4, 1, 1]
Enter a number to change ['q' to quit]>> 1
with string >> hello
List: ['hello', 3, 3, 9, 5, 7, 8, 2, 10, 8, 4, 'hello', 'hello']
The number 1 was replaced 3 times
Enter a number to change ['q' to quit]>> 8
with string >> hi
List: ['hello', 3, 3, 9, 5, 7, 'hi', 2, 10, 'hi', 4, 'hello', 'hel.
The number 8 was replaced 2 times
Enter a number to change ['q to quit]>>
●
Problem 2 (Working with a 2-D list)
Write a program called p2.py that has the following functionality:
Using a loop it creates a two-dimensional list with
elements, such that
Transcribed Image Text:while (event-controlled) loop. Sample output: n >> 13 List: [1, 3, 3, 9, 5, 7, 8, 2, 10, 8, 4, 1, 1] Enter a number to change ['q' to quit]>> 1 with string >> hello List: ['hello', 3, 3, 9, 5, 7, 8, 2, 10, 8, 4, 'hello', 'hello'] The number 1 was replaced 3 times Enter a number to change ['q' to quit]>> 8 with string >> hi List: ['hello', 3, 3, 9, 5, 7, 'hi', 2, 10, 'hi', 4, 'hello', 'hel. The number 8 was replaced 2 times Enter a number to change ['q to quit]>> ● Problem 2 (Working with a 2-D list) Write a program called p2.py that has the following functionality: Using a loop it creates a two-dimensional list with elements, such that
Problem 1 (Working with a list)
Write a program named p1.py that starts with an empty list. Your program must ask the
user for a positive integer n, generate n random integers in the range [1-10] (inclusive),
store them in that list, and print it.
Your program then must repeatedly ask the user to enter a number and a string to replace
all occurrences of that number in the list with that string (e.g., replace all 1's with "hello",
all 8's with "hi", etc.). At every iteration, print the updated list and the number of times a
number was replaced. Your program stops when the user enters 'q'. Input validation is
optional.
Hint: use a for (counter controlled) loop inside a while (event-controlled) loop.
Sample output:
FH
Transcribed Image Text:Problem 1 (Working with a list) Write a program named p1.py that starts with an empty list. Your program must ask the user for a positive integer n, generate n random integers in the range [1-10] (inclusive), store them in that list, and print it. Your program then must repeatedly ask the user to enter a number and a string to replace all occurrences of that number in the list with that string (e.g., replace all 1's with "hello", all 8's with "hi", etc.). At every iteration, print the updated list and the number of times a number was replaced. Your program stops when the user enters 'q'. Input validation is optional. Hint: use a for (counter controlled) loop inside a while (event-controlled) loop. Sample output: FH
Expert Solution
steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
Software products
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning