Question: List manipulation Write a program that takes a number K as input, reads K input strings (one at a time), and stores them in a
List manipulation
Write a program that takes a number K as input, reads K input strings (one at a time), and stores them in a list called mainlist.
Next it converts all strings in mainlist that look like integers (strings of numbers) into Python integers, adds them to a new list called intlist, and removes the corresponding elements from the mainlist.
Finally it prints intlist and then the final mainlist.
Hint: This code snippet may or may be helpful
import string
print (string.digits)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
