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]
2 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]2 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
Is a collection of information stored under a single nam​
ad-work [718]

Answer:

<h2><em>File</em></h2>

plz mark it as brainliest

8 0
3 years ago
Read 2 more answers
Your sister wants to purchase Microsoft Office 2013 for her new laptop. She doesn't want to pay for a subscription, and she want
Pavel [41]

I would buy Microsoft Office 2013 Home and Business Pc License. Its better to purchase the product in all rather than a subscription.

5 0
3 years ago
Write a C program that has the following statements: int a, b; a = 10; b = a + fun(); printf("With the function call on the righ
mart [117]

Answer:Following is the C program:-

#include <stdio.h>

int fun()//function fun of return type int and it returns value 6.

{

   return 6;

}

int main() {

  int a, b;

  a = 10;

  b = a + fun();//adds 6 to a.

  printf("With the function call on the right, ");

  printf("\n%d ",b);//printing b..

return 0;

}

Output:-

With the function call on the right,  

16

Explanation:

The function fun return the value 6 so it adds 6 to a and stores the result in b.

6 0
3 years ago
Im bored anyone up for a convo? lets talk.. =D
aleksandrvk [35]

Answer:

ok im fine with dat <3

6 0
3 years ago
Read 2 more answers
Indicates how fast the engine is moving in rpms.
lapo4ka [179]
That would be called a <span>tachometer </span>
7 0
3 years ago
Other questions:
  • Shawn wants to work on a presentation. He pushes the power buttons for the computer and the monitor, but the computer fails to s
    10·1 answer
  • When the minnesota timberwolves encouraged facebook fans to post a great shot of a dunk onto its pinterest page for a chance to
    6·1 answer
  • Rewrite this if/else if code segment into a switch statement int num = 0; int a = 10, b = 20, c = 20, d = 30, x = 40; if (num &g
    13·1 answer
  • TWO MINUTES LEFT<br> ________ __________ is the physical arrangement of devices on a network.
    9·1 answer
  • What is a column in a table
    10·2 answers
  • Suppose you own a travel agency in a large city. You have many corporate clients, but growth has slowed somewhat Some long-term
    15·1 answer
  • What is a Hard Drive
    13·1 answer
  • Whate is function of northe bridge<br>​
    12·1 answer
  • Name TanushSAVAGE. As given in the picture, Subscribe!
    15·1 answer
  • The rectangle shape in flowchart is used for
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!