Python (Pyodide Write a program in which you ask user to enter a string in a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Python (Pyodide Write a program in which you ask user to enter a string in a loop. if user enters 'Exit' then you print an "Exiting, good by" message and finish the execution of program. If user enters a symmetrical string then your print the message "Its a Palindrome!" and then programe continues for next input. If user enters any other string you print the lenght of the string and the string in reverse order and then program continues to ask user for a new string. [Marks: 10] Please note the following: A string is symmetrical if string is equal to its reverse string (eg: ama, abba, ambma, etc (there are infintly many such strings)). . Your prorgam should exit when user enters word exit with any combination of Upper and Lower case letters (eg: Exit, exit exit, exIT etc are all valid exit commands) Exiting the program means terminating the execution. This can be implemented using break statement in the loop. B please do not use exit() function in jupyter becasue it kills the kernel. Rubric: Main loop that asks for any string: 2 marks Handling of all possilbe exit commands: 1 marks Checking of symmetrical string and printing message: 3 marks Printing of message with string lenght and string in reverse: 2 marks Testing: You have tested your program for atleast one set of values: 1 marks Comments: Add necessary comments to explain the process: 1 marks vate Windo Settings to ac Python (Pyodide Write a program in which you ask user to enter a string in a loop. if user enters 'Exit' then you print an "Exiting, good by" message and finish the execution of program. If user enters a symmetrical string then your print the message "Its a Palindrome!" and then programe continues for next input. If user enters any other string you print the lenght of the string and the string in reverse order and then program continues to ask user for a new string. [Marks: 10] Please note the following: A string is symmetrical if string is equal to its reverse string (eg: ama, abba, ambma, etc (there are infintly many such strings)). . Your prorgam should exit when user enters word exit with any combination of Upper and Lower case letters (eg: Exit, exit exit, exIT etc are all valid exit commands) Exiting the program means terminating the execution. This can be implemented using break statement in the loop. B please do not use exit() function in jupyter becasue it kills the kernel. Rubric: Main loop that asks for any string: 2 marks Handling of all possilbe exit commands: 1 marks Checking of symmetrical string and printing message: 3 marks Printing of message with string lenght and string in reverse: 2 marks Testing: You have tested your program for atleast one set of values: 1 marks Comments: Add necessary comments to explain the process: 1 marks vate Windo Settings to ac
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Gene's Incremental Revenue Worksheet Unit Additional Number Revenue Product Costs Other Variable Contribution to 1 $850 $255 Costs $382.50 Fixed Costs $213 2 $700 3 $650 4 $750 5 $900 Total $3,850 A....
-
ttth Suppose that the sequence of bags {Bn | n N} is recursively enumerated by the computable function e(n, x) = fn(x), [7 marks] Hence prove that the set of all recursive bags cannot be recursively...
-
Research is a process of discovering new knowledge. In the Code of Federal Regulations (45 CFR 46.102(d)) pertaining to the protection ofhuman subjects,research is defined as:...
-
A pot is dropped from the top of a 500-ft building exactly 200 ft above your office. Must it have fallen right past your office window? Try to apply the Intermediate Value Theorem to the above...
-
What are the implications of the fluctuation-dissipation theorem in understanding the statistical fluctuations of thermodynamic variables and their connection to dissipative processes ?
-
List and discuss the major information security and privacy threats to organizations.
-
Focus Fabrication Co. uses ABC. The factory overhead budget for the coming period is $500,000, consisting of the following: Cost Pool Budgeted Amount Direct labor and facility...
-
152. Given these matrices, answer the following questions or compute the following matrices (if they exist). 1 1 4-[91] A = B = 00 10 1 0 [11 1 1 0 C= and D= 0 10 101 a) Calculate Av C. b) Calculate...
-
Your neighbour, Mrs. White, has heard that you were studying personal tax. She has come to you with her financial information for 2020. Mrs. White is a resident of Canada for tax purposes: ...
-
a) We are looking at the same Buck Run region again i. i. II. (2pt) How far away are the two red dots separated in the real world? What is the average gradient (in feet per meter) of the river when...
-
Compute the cash back period for each project from the following data Year 1 2 3 4 5 6 7 8 9 Present Value of $1 at Compound Interest 6% 10% 12% 15% 20% 0.943 0.909 0.893 0.870 0.833 0.890 0.826...
-
The standard 55 gallon drum is H=88 cm high, has an outer diameter of D = 61 cm and is made from 0.9 mm thick steel. You are testing the strength of such a drum. The drum is filled with air and...
-
Fill in all the red forms. Only the pv, fv, pmt formulas in excel can be used. No other formulas can be used, all red forms must be completed AB C PV of Total Tuition Annual Deposit Amount Q1 Henry...
-
S & H FOOTWEAR Hussein graduated from McGill University in 2006 with a degree in business. He has always had an interest in footwear, working part-time in high school at his parents shoe store in...
-
1. Which of the following is the clearest statement of the law of demand? a. As income rises, people buy more of all goods and services b. As price increases, the quantity of a good demanded will...
-
In 1995 Miguel purchased a home for $130,000. In 2000 he sold it for $170,000 and immediately purchased another one for $180,000, which he sold in 2007 for $235,000. How much taxable capital gain, if...
-
Figure P17.65 shows the light intensity on a screen behind a single slit. The wavelength of the light is \(500 \mathrm{~nm}\) and the screen is \(1.0 \mathrm{~m}\) behind the slit. What is the width...
-
If sunlight shines straight onto a peacock feather, the feather appears bright blue when viewed from \(15^{\circ}\) on either side of the incident beam of sunlight. The blue color is due to...
-
The shiny surface of a CD is imprinted with millions of tiny pits, arranged in a pattern of thousands of essentially concentric circles that act like a reflection grating when light shines on them....
Study smarter with the SolutionInn App