Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am new to python pls help me write the correct code for these questions. In In In In In 1. Write a fuction called

I am new to python pls help me write the correct code for these questions.

image text in transcribed
In In In In In 1. Write a fuction called 'fac' that takes an input of number N and output N!.Print the result as N! is result. For example, N = 5, N!=5*4*3*2*1 = 120. Print '5'. is120' 2. Make a plot for y = log(x), x is between 1 and 100. 3. Write a function called "operate" that takes as input two numbers, and a string that can be either "add" or "multiply". The output should be either the sum or product of the two numbers, depending on the string entered. 4. Write a function called "describe" that takes as input a list of numbers, and prints the number of elements in the list, and the mean, variance, and standard deviation. The printed quantities should be labeled. The output should look something like: number of elements: 12 mean: 0.5 variance: 0.04 standard deviation: 0.2 5. A simple substitution code codes 'a' as 1, 'b' as 2, ..., '2' as 25. Write a function called "encode" that takes in a string, and prints the coded text. The output should be a string, with letters separated by ".". Use \"999" for punctuation and spaces. For example, encode("Hello!") should print out "8.5.12.12.15.999"

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Partnering to build customer relationships

Answered: 1 week ago