Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you please answer these questions in the python langauge: 1. Write a function m2in that takes as argument a distance in meters and returns

Can you please answer these questions in the python langauge:

image text in transcribed

image text in transcribed

1. Write a function m2in that takes as argument a distance in meters and returns the same distance in inches 2. Write a function of two arguments, x and y and that returns the value of 1 + x2 + y2 3. Write a function that takes an integer argument n. The function then prints out all the values 1,1 +22,1+22 +32,...,1 + 22 + 32+.. +n2. 4. Write a function that takes n as an argument and returns (-1)n; i.e. return 1 if n is even and 1 if n is odd 5. Write a function of n that calculates the partial sum of the Gregory-Leibniz sum (-1)1 2i + 1 6. Write a function sod of n that finds the sum of all divisors (including 1 but not including n) of n. For example, sod (15)-9. Numbers are called perfect, if they are equal to their sum of divisors. The smallest perfect number is 6. Write a program that prints out all perfect numbers less than 10000 7. Write a program that takes a string as an argument. The function returns the Scrabble value of the string. The Scrabble value is the sum of letter values, given according to the following table: Value Letters blank e, a, , o, n, r, t, 1, s, u 0 2 b, c, m, p 3 f, h, v, w, y l, Z 10

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

More Books

Students also viewed these Databases questions