Question: The first picture is the question regarding the code in the two picutres below in Python. You will be given a list of numbers. Each
The first picture is the question regarding the code in the two picutres below in Python.



You will be given a list of numbers. Each number is assigned a score. Its score is determined as follows: A number's base score is the value of the number itself. If the number is a palindrome it scores is doubled If the number is a prime its score is doubled If the number is a nice number its score is tripled Consider how to determine the score of a number 89 It is not a palindrome and but it is nice and near prime Base score: 89 Score after palindrome check: 89 (remains same as not a palindrome) Score after prime check: 188 (doubled as 89 is prime) Score after nice check: 534 (tripled as 89 is nice) Consider the number 101 It is a palindrome, it is prime but it is not a nice number: Base score: 101 Score after palindrome check: 202 (doubled as it's a palindrome) Score after prime check: 404 (doubled as 101 a prime) Score after nice check: 404 (not tripled as 101 is not nice) Given a list of numbers entered by the user output the list of numbers in sorted order (ascending) of their scores. Also include the score achieved with each number separated by a comma after the number For example if the user enters 89 101 You have to output 101,404 89, 534 You will be given a list of numbers. Each number is assigned a score. Its score is determined as follows: A number's base score is the value of the number itself. If the number is a palindrome it scores is doubled If the number is a prime its score is doubled If the number is a nice number its score is tripled Consider how to determine the score of a number 89 It is not a palindrome and but it is nice and near prime Base score: 89 Score after palindrome check: 89 (remains same as not a palindrome) Score after prime check: 188 (doubled as 89 is prime) Score after nice check: 534 (tripled as 89 is nice) Consider the number 101 It is a palindrome, it is prime but it is not a nice number: Base score: 101 Score after palindrome check: 202 (doubled as it's a palindrome) Score after prime check: 404 (doubled as 101 a prime) Score after nice check: 404 (not tripled as 101 is not nice) Given a list of numbers entered by the user output the list of numbers in sorted order (ascending) of their scores. Also include the score achieved with each number separated by a comma after the number For example if the user enters 89 101 You have to output 101,404 89, 534
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
