Write a Python program that receives two numbers from a user: num1 and num2. You program...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Python program that receives two numbers from a user: num1 and num2. You program checks which is the bigger number. If the bigger number is odd, then in prints the same number in different lines. On each line you print the odd number you then add'-' sign characters for as many as the smaller number. For example, if the larger number entered is odd and it is 5 and the smaller number is 3 then the output should be: 5-.. 5- 5 --- 5 --- 5 --- I However, if the larger number is even then print '+'sign characters for as many as the smaller number then in the end of the line print the even number. Repeat the printing for as many lines as the larger even number. For example, if the larger number entered is even and it is 4 and the smaller number is 2 then the output should be: ++4 ++4 ++4 ++4 Write a Python program that receives two numbers from a user: num1 and num2. You program checks which is the bigger number. If the bigger number is odd, then in prints the same number in different lines. On each line you print the odd number you then add'-' sign characters for as many as the smaller number. For example, if the larger number entered is odd and it is 5 and the smaller number is 3 then the output should be: 5-.. 5- 5 --- 5 --- 5 --- I However, if the larger number is even then print '+'sign characters for as many as the smaller number then in the end of the line print the even number. Repeat the printing for as many lines as the larger even number. For example, if the larger number entered is even and it is 4 and the smaller number is 2 then the output should be: ++4 ++4 ++4 ++4
Expert Answer:
Answer rating: 100% (QA)
Python program python def printpatternnum1 num2 largernumber ... View the full answer
Related Book For
Operating Systems Internals and Design Principles
ISBN: 978-0133805918
8th edition
Authors: William Stallings
Posted Date:
Students also viewed these operating system questions
-
1- What is the difference between Multiprogramming and Multicore, and how do they relate to each other? 2- Each process is represented in the operating system by a process control block (PCB). What...
-
https://www.youtube.com/watch?v=2Ys_OWwIgAo From watching the video on The Goal (i.e., Theory of Constraints) and your understanding of the Economic Order Quantity/Economic Lot Size, would Jonah...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Hybrid Corporation began operations in 2018 and during that year purchased equity investments. It owns less than 20% of the voting shares for all companies whose stock it purchased. The year-end cost...
-
Select one of the companies. Based on the brief statement of its renewed strategy (or research the company for further details), think about how patterns of employee behavior will have to change.
-
Eugene, Oregon Macs Custom Catering, an award- winning catering business located in Eugene, Oregon, specializes in providing only the best for you and your guest. Macs Custom Catering has been in...
-
An observational study to evaluate the effectiveness of supplementing a reading program with a television show was conducted in several schools in grade 4. Some classroom teachers chose to supplement...
-
Rank the following securities from lowest (1) to highest (8) in terms of their riskiness for an investor. All securities (except the Treasury bond) are for a given firm. If you think two or more...
-
For an option trading in the money, what is the likely impact on e binomial option price as the number of binomial steps is increased?
-
AP Vianne is the management accountant for Divvy, a bike-sharing service in Chicago. She is trying to plan for summer activity by using the most recent ridership information provided. She needs to...
-
A gas turbine operates with a regenerator and two stages of reheating and intercooling. A gas turbine operates with a regenerator and two stages of reheating and intercooling. This system is designed...
-
In a world so divided in so many ways, sustainable economic development on a global scale will amount to nothing but a figment of human imagination or, to put it mildly, just wishful thinking. If you...
-
In Section 14.3 there is a list of six specific ways that the industrial system should attempt to imitate nature If this is what it would take to learn from nature do you think it will be rather too...
-
In Section 14.2 three case studies are presented. These case studies clearly indicate that the gain from the adoption of "eco-efficiency" as a strategy for pollution control is most effective when it...
-
As discussed in Section 14.3, eco-effectiveness is a pollution control (management) philosophy that is based on the principle of a "cradle-to-cradle" design strategy. What does this mean? Does...
-
Exhibit 14.1 presents a summary of the Kalundborg Industrial Park-an industrial symbiosis network located in Kalundborg, Denmark. Answer the following questions based on what you have learned from...
-
Can you think of an explanation for the existence of both the anomalies and efficient markets?
-
7. Baladna wants to analyze process that includes delivery by suppliers, production inside the company, transportation to to its customers and information systems. Then it also wants to find out...
-
List the three control problems associated with competing processes and briefly define each.
-
Define: B = block size R = record size P = size of block pointer F = blocking factor; expected number of records within a block Give a formula for F for the three blocking methods depicted in Figure....
-
Consider the following string of page references 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2. Complete a figure similar to Figure 8.14, showing the frame allocation for: a. FIFO (first-in-first-out) b. LRU...
-
Give an example of a requirement on a computer printer.
-
Briefly describe the distinction between requirements and specification.
-
Give an example of a requirement on a digital still camera.
Study smarter with the SolutionInn App