Write a Python code for an arithmetic and geometric figure as shown below. Each number is...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Python code for an arithmetic and geometric figure as shown below. Each number is the sum of above two numbers 1 11 121 1331 14641 1 5 10 10 51 n! (k! (n-k)!) The prompt should be "Please enter a number: " The output should be formatted as In this task, the program gets a number n from the user (1≤n≤20), and prints the n-th valu pyramid in a pyramid shape. You should use return function to return the result. Examplel (The contents highlighted by brown ink are inputs from the user): Please enter a number: 6 Example2 Please enter a number: 3 NOTE: you should strictly follow the prompt/output format to get full marks. Also, you shou define a function whose name is "Honeycomb Triangle" (refer to the OnlineGDB template). [1,1] [1, 2. 11 (1, 3, 3, 11 1 [1, 4, 6, 4, 11 (1, 5, 10, 10, 5, 11 1 2 1 13 3 14 6 4 1 [1] [1,1] [1, 2, 1) Write a Python code for an arithmetic and geometric figure as shown below. Each number is the sum of above two numbers 1 11 121 1331 14641 1 5 10 10 51 n! (k! (n-k)!) The prompt should be "Please enter a number: " The output should be formatted as In this task, the program gets a number n from the user (1≤n≤20), and prints the n-th valu pyramid in a pyramid shape. You should use return function to return the result. Examplel (The contents highlighted by brown ink are inputs from the user): Please enter a number: 6 Example2 Please enter a number: 3 NOTE: you should strictly follow the prompt/output format to get full marks. Also, you shou define a function whose name is "Honeycomb Triangle" (refer to the OnlineGDB template). [1,1] [1, 2. 11 (1, 3, 3, 11 1 [1, 4, 6, 4, 11 (1, 5, 10, 10, 5, 11 1 2 1 13 3 14 6 4 1 [1] [1,1] [1, 2, 1)
Expert Answer:
Answer rating: 100% (QA)
To solve this problem we can use a simple recursive function The function will take an inte... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Consider the partial resource-loading chart shown below. Suppose that you can commit a maximum of eight resource hours per day. a. What are the dates on which project resources are overallocated? b....
-
For the function f(x) = 3 calculate the following function value f(2) = f(3) =
-
Your first assignment was to enter forecasting data. How will SAP use this information?
-
The name of each data Table in an Oracle Server database must be prefixed by the keyword or (True/False)
-
Suppose that a red die and a green die are rolled and the numbers on the sides that face upward are observed. (See Example 7 of this section and Example 2 of the first section.) (a) What is the...
-
Insurance Company of Latin America (ILA) is considering opening an office in the U.S. The two cities under consideration are Philadelphia and New York. The factor ratings (higher scores are better)...
-
The daily financial press is replete with newsworthy releases that bear on the financial operations of publicly traded corporations. Not coincidentally, some of the releases translate to significant...
-
Bob Morin opened a medical practice specializing in surgery. During the first month of operation (August), the business, titled Bob Morin, Professional Corporation (P.C.), experienced the following...
-
An isotope of the element Thallium, Tl-206, undergoes beta decay with a half-life of 3.1 minutes. Assume you begin with 64.00 grams of the thallium isotope, what mass of the isotope will be left...
-
Carter Enterprises is involved in the soybean business in South Carolina, Alabama, and Georgia. The president of the company, Earl Carter, goes to a commodity sale once a month where he buys and...
-
4. A point source Gaussian plume model for a power plant uses 50 m as the effective stack height (see Figure P7.32). The night is overcast. (Note: This is not the same as "cloudy" in this model;...
-
Think about a recent team or group project you were part of. Evaluate your teams performance in the following ways: A. How well did your team set goals and purposes for your writing project up front?...
-
Review your job application documents for effectiveness and fairness.
-
In your newly formed short-term team, share responses to questions about your personal, academic, and professional backgrounds and goals. Take turns responding to questions such as the following:...
-
A. As you choose a culture or cultures to learn about, which do you think would be most helpful for your career? Why? B. Explain what cultural intelligence is. How is it similar to and different from...
-
The conventional Taylor rule places weights of one-half on the inflation gap and output gap, corresponding to the dual mandate of the U.S. central bank. Taking into account what you know about the...
-
Under the Americans With Disabilities Act, which is (are) true? I. The Act requires that companies with at least ten employees set up a specified plan to hire people with disabilities. II. The Act...
-
Grace is training to be an airplane pilot and must complete five days of flying training in October with at least one day of rest between trainings. How many ways can Grace schedule her flying...
-
In 2012, Lou has a salary of $54,000 from her job. She also has interest income of $1,700. Lou is single and has no dependents. During the year, Lou sold silver coins held as an investment for a...
-
Carl and Jenny adopt a Russian orphan. The adoption takes 2 years and two trips to Russia and is final in 2012. They pay $6,000 in 2011 and $7,500 in 2012 of qualified adoption expenses, and have AGI...
-
Ray and Maria Gomez have been married 3 years. They live at 1610 Quince Ave., McAllen, TX 78701. Ray works for Palm Oil Corporation and Maria works for the City of McAllen. Maria's Social Security...
-
Have you experienced artistic portrayals of your own culture or identity that you find offensive? If so, do you think they should be censored? The statue of President Theodore Roosevelt flanked by an...
-
Describe some of the reasons that people make art and give examples of symbolism and ritual in art.
-
What is the core approach to an anthropology of art?
Study smarter with the SolutionInn App