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
Alenkinab [10]
3 years ago
13

Write a function called min that returns the minimum of the two numbers passed in as parameters.

Computers and Technology
1 answer:
Kitty [74]3 years ago
4 0

def min(x,y):

   smallest = x

   if y < smallest:

       smallest = y

   return smallest

x = min(2,1)

print("The min is "+str(x))

Although I wouldn't recommend using the name min for a function because min is the name of an existing function. Best of luck.

You might be interested in
Henry is creating code In JavaScript to run calculations on extremely small numbers. How can he use MIN_VALUE as validation in t
QveST [7]

In creating code in JavaScript to run calculations on extremely small numbers, MIN_VALUE as validation in the program can be use to check the lowest value JavaScript can handle

Number.MIN_VALUE returns the smallest positive numeric value representable in JavaScript.  It is the number more closer to zero. The value is approximately 5e⁻³²⁴.

Using Number.MIN_VALUE, the value can be printed as follows:

val = Number.MIN_VALUE;

console.log(val); // 5e-324

Therefore, In creating code in JavaScript to run calculations on extremely small numbers, MIN_VALUE as validation in the program can be use to check the lowest value JavaScript can handle.

learn more on JavaScript here: brainly.com/question/13041378?referrer=searchResults

3 0
2 years ago
You listened to a song on your computer. did you use hardware or software? explain.
scZoUnD [109]
Software, unless you planned on permanently downloading the Music Album or Song to your computer's Hard Drive. i.e, you would use whatever Music or Media player you have installed on your computer, and that simply counts as Software. 
4 0
3 years ago
The data structure used for file directory is called
Aleks04 [339]
This is a tough question. I’m not sure if I’ll get it right but I’ll try.

Data structures used for file directories typically have a hierarchical tree structure, referred to as a directory structure. The tree has a root directory, and every file in that system has a unique path.

The simplest method of implementing a directory is to use a linear list of file names with pointers to the data blocks. But another way that you can format a file directory is by using a hash table. With this method, the linear list stores the directory entries, but a hash data structure is also used. The hash table takes a value computed from the file name and return the pointer to the file name any linear list.

So I think it’s C. But I’m not 100% sure.

I hope that helps.
6 0
3 years ago
Two numbers are given (numbers are entered from the keyboard). If both numbers are positive, then output their sum, if both numb
AleksAgata [21]

Answer:

The program in Python is as follows:

num1 = int(input())

num2 = int(input())

if num1 >=0 and num2 >= 0:

   print(num1+num2)

elif num1 <0 and num2 < 0:

   print(num1*num2)

else:

   if num1>=0:

       print(num1**2)

   else:

       print(num2**2)

Explanation:

This gets input for both numbers

num1 = int(input())

num2 = int(input())

If both are positive, the sum is calculated and printed

<em>if num1 >=0 and num2 >= 0:</em>

<em>    print(num1+num2)</em>

If both are negative, the products is calculated and printed

<em>elif num1 <0 and num2 < 0:</em>

<em>    print(num1*num2)</em>

If only one of them is positive

else:

Calculate and print the square of num1 if positive

<em>    if num1>=0:</em>

<em>        print(num1**2)</em>

Calculate and print the square of num2 if positive

<em>    else:</em>

<em>        print(num2**2)</em>

3 0
2 years ago
This isn't an academic question, but it's a question about something I am consistently seeing on Brainly, so please don't delete
s344n2d4d5 [400]
Yes it does. Hope that answers
3 0
2 years ago
Read 2 more answers
Other questions:
  • Why do you think LinkedIn has become so popular?
    6·1 answer
  • Lydia used software to calculate the budget for each department. To create this budget, she used a _____.
    7·2 answers
  • Nick is working on a new graphic for one of his company’s clients and is having an issue with the color on his screen. The clien
    8·1 answer
  • Besides the Computer Inventory and Maintenance form, what other documentation should you keep on each computer? How might you st
    8·1 answer
  • 2.7 code practice question 1 edhesive
    13·2 answers
  • What is the difference between head header and heading in HTML​
    8·1 answer
  • Code: ckg-jbqp-hki<br>only girls join❤️​
    11·2 answers
  • What type of software is an antivirus?
    5·2 answers
  • Assume that students in a course are required to produce a written report on an ICT-related
    14·1 answer
  • Which of the following is the key business objective behind the technologies implemented by PCL Construction, as discussed in th
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!