Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Number 3, 4 and 5 are related questions. Please give detailed explanations beside every code. Thank you. 2. Standard Deviation of a List Below is
Number 3, 4 and 5 are related questions. Please give detailed explanations beside every code. Thank you.
2. Standard Deviation of a List Below is a function that takes the standard deviation of a list. Write a Python func- tion 'std(x)' that takes a non-empty list 'x' and returns its standard deviation. The return value of the 'std(x)' function should be correct to within 2 decimal digits. stdev = 1 Li=1 (xi m)2 n-1 where m is the average of all the entries of the list, and n is the number of entries in the list. 3. Reversing a string Here's an easy task! Create a function called reverseString which takes in parameter **s**, and returns a string with the letters in the reverse order. For example: reverse Word(?!hello); output:= 'olleh!' reverse Word('Notice These Spaces'); output:= 'secaps esehT ecitoN' Note: Remember the above are just sample cases, your function should work accord- ingly regardless of the string input size or char; 4. Reversing a string - with a loop Do question 3(a) again, but this time do it with a loop (if you didn't do it with a loop before). If you did it with a loop, try to do the same thing using library functions! 5. Translation...? By now you should be very familiar with menial tasks such as reversing every letter in a word. Let's use this to create an ancient foreign language from a sentence full of words; the best words. Create a function 'translateLite' which takes a string parameter **sentence** (note how words in sentences are always space-seperated), and returns the new string. Your solution in question 4 should make use of one of the functions you wrote for question 3. For example: ""May the force be with you'; output:= 'yaM eht ecrof eb htiw uoy( "Ouch my back!""; output:= ""hcuo ym !kcab ""I'm walking on the sunshine; output:= m'I gniklaw no eht enihsnus. Note: Remember the above are just sample cases, your function should work regard- less of the string input size or char. 6. Roman-ish numerals Roman numerals are slightly tricky: the same letter should not be used more than 3 times, so 4 isn't IIII, it's IV. In this part of the question, however, we will be lazy: we can use the same letter up to 4 times. Write a Python function romanish that takes an integer smaller than 1000 and returns a string representation in this lazy form of Roman numerals. Example: romanish(1) == 'I' romanish(5) == 'V? romanish(9) == 'VIIII romanish(39) == ?XXXVIIII romanish(50) == 'L' romanish(100) == 'CStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started