Write a program that takes a user-input number and then determines which number in  theList is closest to the user-input number. theList = ["846", "757", "383", "988", "347", "136", "616", "385", "742", "646", "755", "936", "612", "690", "255", "278", "285", "199", "408", "613", "337", "568", "284", "848", "411", "384", "423", "721", "567", "339", "162", "489", "637", "358", "992", "571", "365", "361", "341", "756", "255", "547", "493", "807", "181", "921", "480", "549", "415", "904", "713", "195", "309", "612", "231", "104", "142", "229", "570", "921", "234", "796", "727", "767", "439", "525", "588", "934", "631", "708", "447", "833", "373", "654", "719", "970", "698", "865", "943", "330", "154", "732", "716", "273", "116", "957", "713", "593", "825", "618", "436", "803", "203", "948", "508", "305", "473", "128", "495", "620", "865", "878", "682", "443", "693", "518", "757", "563", "437", "122", "588", "782", "452", "171", "847", "141", "310", "502", "339", "166", "360", "599", "174", "477", "325", "128", "882", "536", "790", "684", "928", "252", "436", "437", "108", "817", "969", "105", "776", "137", "968", "983", "952", "973", "835", "295", "726", "589", "644", "413", "102", "308", "471", "322", "371", "235", "616", "706", "532", "455", "601", "784", "224", "523", "773", "653", "403", "491", "625", "229", "581", "779", "122", "583", "567", "636", "585", "338", "797", "469", "305", "741", "569", "891", "992", "600", "993", "535", "392", "726", "603", "854", "845", "473", "287", "705", "846", "543", "336", "874", "941", "376", "164", "921", "743", "938", "399", "248", "513", "372", "410", "614", "685", "899", "146", "253", "944", "985", "950", "395", "931", "841", "430", "248", "234", "745", "846", "270", "852", "151", "576", "406", "794", "494", "307", "195", "291", "763", "132", "328", "124", "318", "935", "580", "226", "941", "851", "251", "796", "892"]

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write a program that takes a user-input number and then determines which number in  theList is closest to the user-input number.

theList = ["846", "757", "383", "988", "347", "136", "616", "385", "742", "646", "755", "936", "612", "690", "255", "278", "285", "199", "408", "613", "337", "568", "284", "848", "411", "384", "423", "721", "567", "339", "162", "489", "637", "358", "992", "571", "365", "361", "341", "756", "255", "547", "493", "807", "181", "921", "480", "549", "415", "904", "713", "195", "309", "612", "231", "104", "142", "229", "570", "921", "234", "796", "727", "767", "439", "525", "588", "934", "631", "708", "447", "833", "373", "654", "719", "970", "698", "865", "943", "330", "154", "732", "716", "273", "116", "957", "713", "593", "825", "618", "436", "803", "203", "948", "508", "305", "473", "128", "495", "620", "865", "878", "682", "443", "693", "518", "757", "563", "437", "122", "588", "782", "452", "171", "847", "141", "310", "502", "339", "166", "360", "599", "174", "477", "325", "128", "882", "536", "790", "684", "928", "252", "436", "437", "108", "817", "969", "105", "776", "137", "968", "983", "952", "973", "835", "295", "726", "589", "644", "413", "102", "308", "471", "322", "371", "235", "616", "706", "532", "455", "601", "784", "224", "523", "773", "653", "403", "491", "625", "229", "581", "779", "122", "583", "567", "636", "585", "338", "797", "469", "305", "741", "569", "891", "992", "600", "993", "535", "392", "726", "603", "854", "845", "473", "287", "705", "846", "543", "336", "874", "941", "376", "164", "921", "743", "938", "399", "248", "513", "372", "410", "614", "685", "899", "146", "253", "944", "985", "950", "395", "931", "841", "430", "248", "234", "745", "846", "270", "852", "151", "576", "406", "794", "494", "307", "195", "291", "763", "132", "328", "124", "318", "935", "580", "226", "941", "851", "251", "796", "892"]

Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY