1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
belka [17]
3 years ago
15

Create a Python program as described below and save it in a file named bool. You should use IDLE or similar environment to creat

e your program. First develop a conceptual model and document it using either pseudo code or a flowchart to meet the requirements of the program described as follows.

Computers and Technology
1 answer:
Eva8 [605]3 years ago
8 0

PYTHON CODE

# function to compare a and b
def compare(a,b):

    # if a is greater than b , return 1
    if a > b:
        return 1

    # if a and b are equal, return 0
    elif a == b:
        return 0

    # if a less than b , return -1
    elif a < b :
        return -1


# testing
if __name__=="__main__":

    # calling the compare function with a and b
    print('compare(5,2) %d'%compare(5,2))
    print('compare(2,5) %d'%compare(2,5))
    print('compare(3,3) %d'%compare(3,3))

    # getting values for a and b
    a=int(input("Enter the value for a: "))
    b=int(input("Enter the value for b: "))

    print('compare(%d,%d) %d'%(a,b,compare(a,b)))

(see attachment for output)

You might be interested in
If somebody is using a laptop at a coffee shop, how are they likely connected to a network?
marusya05 [52]

Answer:

by signing into the wifi network they have

Explanation:

4 0
3 years ago
A file manager is used for all of the following except ____. A. to move files and folders B. to reorder files and folders C. to
Alex73 [517]

Answer:

A .to move files and folders

5 0
3 years ago
Read 2 more answers
Which of these monitor connector types is the oldest and least desirable to use?
ella [17]

Answer:

DVI is the oldest out of the four.

Explanation:

DVI and VGA are the oldest, but DVI is oldest and least desirable to use since it is outdated.

5 0
3 years ago
Read 2 more answers
Which of the following is not a characteristic of a motorcycle?
MrRa [10]

Answer:

the correct answer is A

3 0
3 years ago
What is the minimum number of bits required to store 11 different values?
yawa3891 [41]

Answer:

4 bits are required. 4 bits can represent 16 different values (2*2*2*2 or ). 3 bits can only represent 8 different values. In the general case n bits can represent values, or correspondingly m values can be represented by bits.

5 0
3 years ago
Other questions:
  • Write a calculator program using a switch statement that: a) Prompts the user to enter two numbers b) Prompts the user to select
    13·1 answer
  • In GIMP, the ( ) displays the image that the user is currently working on
    12·1 answer
  • Alex's woodworking shop is trying to design a web page with Cascading Style Sheets (CSS). Alex would like create the new design
    11·1 answer
  • Which of the following is an HTTP response status type?
    12·1 answer
  • NoSQL is a programming language used to create mobile apps.<br> a) True<br> b) False
    13·2 answers
  • The construction of a mixed media assemblage would be considered
    9·1 answer
  • PLEASE HELP<br>what are some benefits of using graphic on web page?​
    6·1 answer
  • You are an IT administrator troubleshooting a Windows-based computer. After a while, you determine that you need to refresh the
    10·1 answer
  • A timer is set after each frame is sent before waiting an ACK for that frame, how long does the timer take to be expired?
    10·1 answer
  • The tcp protocol provides error detection and correction. <br><br> a. True <br> b. False
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!