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

Note: Be sure to include comments for all functions that you use or create.

For example, if you made a call like

x = min(10, 14)
x should have the value 10.

For your program, you need to define the function and call it and print out the result like this:

x = min(10, 14)
print("The min is " + str(x))

min(1,2);
min(9000,9001);

it is in python

Answers

Answer 1

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.

Answer 2

The function is an illustration of conditional statements.

Conditional statements are statements whose execution depends on their truth values.

The function in Python, where comments are used to explain each line is as follows:

#This defines the function

def min(num1,num2):

#This initializes minVal

  minVal = num2

#If num1 is less than num2, then

  if num1 < num2:

#minVal equals num1

      minVal = num1

#This returns the smaller value

  return minVal

At the end of the program, the smaller value is returned to the main

Read more about similar programs at:

https://brainly.com/question/6973180


Related Questions

A secure website has https instead of http in web address true or false

Answers

Answer:

True

Explanation:

https has SSL which http doesn't. SSL encrypts your information so your connections are secured. Therefore websites with https are more secure.

What music form states a musical theme and then changes it in the next sections?

Answers

Answer:

musical varations

Explanation:

where it goes from one sound to another

How do I keep my computer and data safe and secure while using the Internet?

Answers

Answer:

Don’t answer anything unless it’s someone who you know.

Explanation:

Some things that I use is a VPN...

Also make sure not to overshare information on social media...

Oh and don't use the same password for everything (I'm guilty of this one lol)

Using the drop-down menu, identify the common IDE components.
A
tests a program one step at a time to find and fix errors.
А
translates the program from high-level programming language into machine
language so it is ready to run whenever it is called.
The
v is the main programming tool used to create, modify, and save code.
The
tool helps programmers write directions for repetitive tasks as they construct a
program
An
v translates each line of code from high-level programming language to machine
language and executes it when it is called to run.

Answers

Answer:

test a program one step at to find and fix errors

Answer:

debuger

compiler

source code editor

build automation

interpreter

Explanation:

what are storage devices??
name them​

Answers

Answer:

those devices which store data and information are called storage device.

some of them are : hard drive ,compact disc,

floppy disc

I am coding a turtle race in python I have to Use a single call to forward for each turtle, using a random number as the distance to move

Answers

import turtle,random

s = turtle.getscreen()

t1 = turtle.Turtle()

t2 = turtle.Turtle()

t3 = turtle.Turtle()

t2.penup()

t2.goto(1,100)

t3.penup()

t3.goto(1,200)

while True:

   t1.forward(random.randint(1,10))

   t2.forward(random.randint(1,10))

   t3.forward(random.randint(1,10))

   if t1.xcor() >= 180:

       print("Turtle 1 won the race!")

       quit()

   elif t2.xcor()>= 180:

       print("Turtle 2 won the race!")

       quit()

   elif t3.xcor() >= 180:

       print("Turtle 3 won the race")

       quit()

I hope this helps!

Answer:

if you mean to set a speed. Im not sure. however, move turtle.forward(random number) i can do

import turtle

import random

random_int = random.randint(20, 1000)

win = turtle.Screen()

turtle_1 = turtle.Turtle()

turtle_1.forward(random_int)

win.mainloop()

Write a program in QBASIC to display the first 10 numbers of the fibonacci series:
0,1,1,2,3,5,... up to 10 terms.

(Hint- Take the first two numbers 0 and 1. Now obtain the next number by adding them. For example:0+1=1)

Answers

Answer:

#include<iostream>

using namespace std;

int main()

{

int a=0,b=1;

int i,c;

cout<<a<<" "<<b<<" ";

for(i=3;i<=10;i++)

{

 c=a+b;

 cout<<c<<" ";

 a=b;

 b=c;

}

return 0;

}

Explanation:

What program has unique drag and drop support functions?

Answers

Answer:

theres actually alot

Explanation:

apple has a drop file function where you drag and drop

ill name a few

dropbox, apple, windows, linux etc.

A scatter plot can be used with both numerical and non numerical values. True or False?

Answers

Answer:

true

Explanation:

Can someone tell me what to do?

Answers

Answer:

are you coding ?

Explanation:

(JAVA PLS)

Your job in this assignment is to write a program that takes a message as a string and reduces the number of characters it uses in two different set ways. The first thing your program will do is ask the user to type a message which will be stored as a String. The String entered should be immediately converted to lowercase as this will make processing much easier. You will then apply two different algorithms to shorten the data contained within the String.

Algorithm 1

This algorithm creates a string from the message in which every vowel (a, e, i, o, and u) is removed unless the vowel is at the very start of a word (i.e., it is preceded by a space or is the first letter of the message). Every repeated non-vowel character is also removed from the new string (i.e., if a character appears several times in a row it should only appear once at that location). So for example the string "I will arrive in Mississippi really soon" becomes "i wl arv in mssp rly sn".

After applying this algorithm, your program should output the shortened message, the number of vowels removed, the number of repeated non-vowel characters removed, and how much shorter the shortened message is than the original message. The exact format in which the program should print this information is shown in the sample runs.

Algorithm 2

This algorithm creates a string by taking each unique character in the message in the order they first appear and putting that letter and the number of times it appears in the original message into the shortened string. Your algorithm should ignore any spaces in the message, and any characters which it has already put into the shortened string. For example, the string "I will arrive in Mississippi really soon" becomes "8i1w4l2a3r1v2e2n1m5s2p1y2o".

After applying this algorithm, your program should output the shortened message, the number of different characters appearing, and how much shorter the shortened message is than the original message. The exact format in which the program should print this information is shown in the sample runs.

Sample Run 1
Type the message to be shortened
This message could be a little shorter

Algorithm 1
Vowels removed: 11
Repeats removed: 2
Algorithm 1 message: ths msg cld b a ltl shrtr
Algorithm 1 characters saved: 13

Algorithm 2
Unique characters found: 15
Algorithm 2 message: 4t2h2i4s1m5e2a1g1c2o1u3l1d1b2r
Algorithm 2 characters saved: 8
Sample Run 2
Type the message to be shortened
I will arrive in Mississippi really soon

Algorithm 1
Vowels removed: 11
Repeats removed: 6
Algorithm 1 message: i wl arv in mssp rly sn
Algorithm 1 characters saved: 17

Algorithm 2
Unique characters found: 13
Algorithm 2 message: 8i1w4l2a3r1v2e2n1m5s2p1y2o
Algorithm 2 characters saved: 14

Answers

import java.util.Scanner;

public class JavaApplication54 {

   public static int appearance(String word, char letter){

       int count = 0;

       for (int i = 0; i < word.length(); i++){

           if (word.charAt(i) == letter){

               count++;

           }

       }

       return count;

   }

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Type the message to be shortened");

       String message = scan.nextLine();

       message = message.toLowerCase();

       int volCount = 0, repCount = 0, num = 0;

       char prevC = ' ';

       String vowels = "aeiou";

       String newMessage = "";

       for (int i = 0; i < message.length(); i++){

           char c = message.charAt(i);

           

           if (vowels.indexOf(c) != -1 && prevC == ' '){

               newMessage += c;

           }

           else if (vowels.indexOf(c) == -1 && prevC != c){

               newMessage += c;

           }

           else if (vowels.indexOf(c) != -1){

               volCount ++;

           }

           else{

               repCount++;

           }

            prevC = c;

       }

       System.out.println("Algorithm 1");

       System.out.println("Vowels removed: "+volCount);

       System.out.println("Repeats removed: "+repCount);

       System.out.println("Algorithm 1 message: "+newMessage);

       System.out.println("Algorithm 1 characters saved: "+(message.length() - newMessage.length()));

       

       String uniqueMessage = "";

       

       for (int i = 0; i<message.length(); i++){

           char w = message.charAt(i);

           if (uniqueMessage.indexOf(w)== -1 && w!=' '){

               uniqueMessage += appearance(message,w)+""+w;

               num++;

           }

       }

       System.out.println("Algorithm 2");

       System.out.println("Unique characters found: "+num);

       System.out.println("Algorithm 2 message: "+uniqueMessage);

       System.out.println("Algorithm 2 characters saved: "+(message.length() - uniqueMessage.length()));

   }

   

}

I hope this helps!

What is Hypertext Transfer Protocol?
A.
the language used to build web pages
B.
a set of rules that allows for exchange of information on the web
C.
the language used by computers to exchange information on the web
D.
a set of rules that defines what search engines can do

Answers

Answer:

B, rules which allows the exchange of information on the web

Explanation:

The HTTP is a protocol which is used to fetch information from a server/webpage, and is usually initiated by a user. This is not to be confused with HTML (Hypertext Markup Language), which is used to program webpages.

If you were going to construct a table that only included shapes name with number prefixes, which shape would you inlcude?
Asap

Answers

Answer: Triangle

Explanation: Triangle has Tri

JAVA

Take two String inputs of the same length and merge these by taking one character from each String (starting with the first entered) and alternating. If the Strings are not the same length, the program should print "error".

Sample Run 1:

Enter Strings:
balloon
atrophy
baatlrloopohny
Sample Run 2:

Enter Strings:
terrible
mistake
error

Answers

import java.util.Scanner;

public class JavaApplication53 {

   

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Enter Strings:");

       String txt1 = scan.nextLine();

       String txt2 = scan.nextLine();

       String newTxt = "";

       if (txt1.length() != txt2.length()){

           System.out.println("error");

       }

       else{

           for (int i = 0; i<txt1.length(); i++){

               newTxt += txt1.charAt(i)+""+txt2.charAt(i);

           }

       }

       System.out.println(newTxt);

   }

   

}

I hope this helps!

What is unique about a dual-axis chart

Answers

Answer:

B: Data is charted by two different types of data.

Explanation:

Got it correction edge.

Answer: B: Data is charted by two different types of data

Explanation:

i just answered it on edge


Which device contains or manages shared resources in a network?
O the router
O the client
the switch
o the server

Answers

Answer:

The server

Explanation:

The router makes the network and the client access the files on the networks. This files are hosted on the server

The server contains or manages shared resources in a network. The correct option is D.

What is a server?

A computer program or apparatus that offers a service to another computer program and its user, also known as the client, is referred to as a server.

The actual computer that a server program runs on in a data centre is also frequently referred to as a server.

Data is sent, received, and stored by a server. It basically "serves" another purpose and is there to offer services.

One or more services may be offered via a server, which can be a computer, software application, or even a storage device. In a network, the server holds or oversees shared resources.

Thus, the correct option is D.

For more details regarding server, visit:

https://brainly.com/question/30168195

#SPJ6

How can goal setting help with academic performance?
a) it helps you focus on what needs to be done.
b) it is an effective study skill.
c) writing goals down makes them happen
d) they help you understand content better

Answers

Im pretty sure the answer is b.

8.7 Code Practice Question 3
Use the following initializer list:
w = [“Algorithm”, “Logic”, “Filter”, “Software”, “Network”, “Parameters”, “Analyze”, “Algorithm”, “Functionality”, “Viruses”]

Create a second array named s. Then, using a loop, store the lengths of each word in the array above. In a separate for loop, print on separate lines the length of the word followed by the word

Answers

I included my code in the picture below.

The for loop that can be used to loop through the array s and get the length and the word is a follows:

s = ["Algorithm", "Logic", "Filter", "Software", "Network", "Parameters", "Analyze", "Algorithm", "Functionality", "Viruses"]

for i in s:

   print(len(i), ":", i)

The variable s is used to store the array of strings

The for loop is used to loop through the array .

The length of each string and the string is printed out.  

When the code is run, you will get exactly like the sample Run.  

learn more: https://brainly.com/question/23800781?referrer=searchResults

Complete the sentence.

A security program must be user-friendly and ensure employers and customers are ______
to use the security measures

1.) afraid
2.) encouraged
3.) discouraged

Answers

Answer 2.) encouraged

Question # 4
Multiple Choice
Which of the following led to the development of the computer?


Enigma machine

morse code

sonar

telephone

Answers

Answer:

Explanatio Morse code

Write an IF…ELSE program that computes the new salary for Ann, the Chief Information Officer of ABC Company. Ann’s current salary is $92,000 a year, and she has worked at ABC for four years. Please note the following: one-year employees get a 2 percent raise two-year employees get a 3 percent raise three-year employees get a 4 percent raise four-year employees get a 5 percent raise five-year employees get a 6 percent raise What is Ann’s new salary?


I’ll make you the brainless if you can help me plz

Answers

In python 3.8:

salary = 92000

years = 4

if years == 1:

   salary += (salary*0.02)

elif years == 2:

   salary += (salary * 0.03)

elif years == 3:

   salary += (salary *0.04)

elif years == 4:

   salary += (salary*0.05)

elif years >= 5:

   salary += (salary*0.06)

print(salary)

If we run this code, Ann's new salary will be 96600.

explain logic circuit​

Answers

Computers often chain logic gates together, by taking the output from one gate and using it as the input to another gate. We call that a logic circuit. Circuits enables computers to do more complex operations than they could accomplish with just a single gate. The smallest circuit is a chain of 2 logic gates.

Logic circuits include such devices as multiplexers, registers, arithmetic logic units (ALUs), and computer memory, all the way up through complete microprocessors, which may contain more than 100 million gates. In modern practice, most gates are made from MOSFETs (metal–oxide–semiconductor field-effect transistors).

A patient calls the insurance company's call center
to be directed to the on-call nurse. The patient
provides his Social Security number, date of birth,
and policy number to the call center employee so
his call can be transferred appropriately. The
employee makes sure not to say the patient's
Social Security number out loud

Answers

Answer:

Respect confidentiality of data

Explanation:

The employee makes sure not to say the patient's Social Security number out loud to Respecting the confidentiality of the data.

What is insurance?

Insurance is a strategy used to safeguard a person from impending financial losses and other projected losses. Additionally, you can get health, property, or auto insurance. A person typically purchases health insurance in order to protect their health or wellbeing. When a person needs medical attention, health care offers financial assistance.

As the person's data that has been taken from the person is treated as confidential and if leaked may affect the life of that person. In order to protect patient privacy, the staff is careful to keep the participant's Social Security information to themselves and their family.

Learn more about insurance, here:

https://brainly.com/question/1400638

#SPJ2

what tells the hardware what to do and how to do it?
Software
Hard drive (Hdd)
hardware
Cpu

Answers

Answer:

I think its CPU

Explanation:

Choose all that apply.

Which statement below describes the use of lists in presentation programs?

Bullets can be turned off and on.
Lists don't have to use numbers or bullets.
Use bulleted lists but not numbered lists.
Use numbered and bulleted lists.
Use numbered lists but not bulleted lists.

Answers

Answer:

Bullets can be turned off and on.

Lists don't have to use numbers or bullets.

Explanation:

because L just wanted the light

The statement that describes the use of lists in presentation programs is that bullets can be turned off and on, and use numbered and bulleted lists. The correct options are A and D.

What are bullets?

A bullet point is a symbol used in writing to introduce a list item. A centered dot (•) is a common symbol for a bullet point, but many other symbols and characters can be used in bullet point lists. Bulleted lists may also include numbers and/or letters.

Each paragraph in a bulleted list begins with a bullet character. Each paragraph in a numbered list begins with an expression that includes a number or letter as well as a separator such as a period or parenthesis.

When you add or remove paragraphs from a numbered list, the numbers in the list are automatically updated.

Bullets can be turned off and on, and numbered and bulleted lists can be used.

Thus, the correct options are A and D.

For more details regarding presentations, visit:

https://brainly.com/question/14498361

#SPJ2

The profile picture that you plan to use to market your professional brand on social media networks should feature you only.

True

False

Answers

Answer:

false

Explanation:

4.8 code practice question 2

Answers

Answer:

Written in Python

for count in range(88, 42,-2):

    print(count,end=' ')

Explanation:

The programming language is not stated.

However, I used python to answer the question.

First, we need to loop from 88 to 44 with a difference of -2 in each term.

This is implemented as

for count in range(88, 42,-2):

Which means to start at 88 and ends at 42 - (-2) which is 44 with an increment of -2

Next, is to print the current iterating value;

This is implemented using print(count)

However, since all values are to be printed on a line, there's a need t modify the statement as: print(count,end=' ')

Is a MODEM required for Internet Connectivity ?
Yes
No

Answers

Answer:

you can connect to the wifi on your device it will say you are connected but the wifi will not be connected to the internet so you will be able to do nothing on it without the modem

Explanation:

Answer:

NEED modem between the cable and your computer. No modem, no Internet.

The Answer is NO

Did anyone else remember that Unus Annus is gone? I started crying when I remembered.... Momento Mori my friends.... Momento Mori...

Answers

Answer:

???

Explanation:

Did I miss something?

Answer:

Yes I remember its gone.  

Explanation:  I was there when the final seconds struck zero.  The screen went black, and the people screaming for their final goodbyes seemed to look like acceptance at first.  I will never forget them, and hopefully they will remember about the time capsule.  Momento Mori, Unus Annus.  

PLS HURRY!!! Look at the image below!
The choices for the second part are number +1, number, number -1

Answers

1. <1

2. -1

Explanation:

Other Questions
Which ordered pair represents a reflection of the point (-3, 5) across the y-axis?(-3,5)(-3, -5)(3,-5)(3,5) How do the words "microscopic eye," "pry," "inspect," and "dissolve"in stanzas 1-2 affect the tone of the poem? 5.Which of these scales are equivalent to 3 inches to 1 yard? Select all that apply.A.1 inch to 1 footB.6 inches to 9 feetC.1 inch to yardD1 inch to 12 inchesPlease help Emma jogs 2 miles along the beach in 13 of an hour. If she travels at a constant rate, how far will she jog in an hour? Question 13 Which of the following will NOT occur when water undergoes a physical change? The motion of the molecules increases. The molecules form new chemical bonds. c The molecules become less closely packed. D The kinetic energy of the molecules increases Which side hired German mercenary soldiers during the revolutionary war, A. United StatesB. Great Britain _______________is energy that uniformly fills the entire universe.A) Cosmic force fieldB) Cosmic background radiationC) X-ray radiationD) Light energy One group of New Deal opponents did not think the programs did enough to help Americans. This group most likely argued that theprograms needed to do more for the poor and elderly.government needed to ensure wealth remained with the rich.programs needed to let the economy take its own course.government took too much power away from the states Twenty-three tribes in Washington operated gaming facilities in 2013, showing that American Indiansenjoy gambling as much as other Americans,rave This question I will never understand, someone please help Some of the steps in Liam solution to 3. 5 (1.25x + 0.5) = 10.5 are shown complete the boxes with reasons for lines 2 and 4 of Liam solution in simple terms, what does the seventh amendment protect us from? The price of a set of feeding bowls for dogs had been $9.25, but wasincreased to $11.10. What was the percent increase? What are the three main parts that make up GAIA? Briefly explain and describe each. Please help with this I will give brainliest Express 14 : 44 in the lowest term. HELP GEO QUESTION THX... GIVE ME EXPLANATION PLZZZZZ THXXXXX SOO MUCCHHHH if you help me I'll mark you the brainest Here are two Desmos Click Bots along with some data from their practice rounds.Which bot will click more times in 10 seconds? Jamal is collecting weather data for a science project. He wants to measure wind speed. Which of the tools below should he use PLEASE HELPP....Write an equation of a line that goes through the given point (7, 1) and has a slope of 8. (Remember: it should be in the form of y = mx + b)