answer.
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
ASHA 777 [7]
1 year ago
5

Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 3 8 the output is

: 8 3 Your program must define and call the following function. swap_values() returns the two values in swapped order. def swap_values(user_val1, user_val2)
Computers and Technology
1 answer:
Misha Larkins [42]1 year ago
4 0

Answer:

The program to this question can be given as:

Program:

def swap_values(user_val1, user_val2):  #define function

   return (user_val2, user_val1) #return values

if __name__ == '__main__': #define constructor.

   n1 = int(input('Enter first number :')) #input value form user

   n2 = int(input('Enter second number :')) #input value form user

   (n1,n2) = swap_values(n1,n2) #hold function values.

   print(n1) #print values

   print(n2) #print values

Output:

Enter first number :3

Enter second number :8

8

3

Explanation:

The explanation of the above python program can be given as:

  • In the python program we define a function that is "swap_values". This function takes two integer values that is "user_val1 and user_val2" as a parameters and returns variable values that is "user_val2 and user_val1".
  • Then we use a constructor in this we define two variable that is "n1 and n2" these variable are use to take user-input from the user and pass the value into the function.  
  • To hold the value of the function we use n1 and n2 variable and print these variable value.
You might be interested in
HELP PLEASE ASAP brainliest to accurate
Svet_ta [14]
A patent law

Patent laws deal with new inventions and relays to the owner’s exclusive right to the claimed invention. It is a right that should be granted by the government to an inventor, to exclude others from using, making, importing, or selling an invention. In this case, Jenna's secret, unique recipe is her patent.


3 0
2 years ago
Read 2 more answers
When handling project scope creep, which are two things that all parties involved need to be aware of?
WARRIOR [948]

Additional resource needed for the projects

Additional time needed for the project

<u>Explanation:</u>

In any project handing their will expected diversion and add on requirement, so to complete a project additional time and additional resource is required to finish a project.

As advice due the project details, end user has keep enough buffer for deviations on resource of man power and additional times taken to finish the project.

While design the project each scope of work is measure with additional time to complete the task

Each scope of work is considered as task in project management.

3 0
1 year ago
An employee sets up an automation that transfers files in a specific folder on their PC to a remote drive for archiving, provide
Yuri [45]

Answer:

Rule based automation

Explanation:

8 0
1 year ago
def retry(operation, attempts): for n in range(attempts): if operation(): print("Attempt " + str(n) + " succeeded") ___ else: pr
marusya05 [52]

Answer:

Following are the missing code to this question:

break;

Explanation:

In the given python code, a method "retry" is defined, that accepts two-variable, that is "operation and attempts" in its parameters, inside the method a for loop is defined that uses the n variable to holds attempt values and define the conditional statement.

  • Inside if block, it checks if the operation value is true, it will print a successful attempts values and break the condition, otherwise it will goto else block.
  • In the else block, it will print failed attempts values.  
6 0
1 year ago
List at least three kinds of harms that a company could encounter from lost of service, that is, failure of availability. List t
WINSTONCH [101]

Answer:PART A

(1) Virus attack

(2) Fraud achieved by manipulating records by hackers

(3) Intellectual property theft.

PART B

COMPUTER SYSTEM

PART C

It will hurt the company in the following ways

(1) Loss business opportunities

(2) Increase in cost of operation as it will result in making certain expenses for it to be restored

(3) Loss of work time.

Explanation: Harm is any unanticipated eventualities that are capable of adversely affecting a person or an organisation. Harm can be as a result of theft or loss of certain resources which includes the COMPUTER SYSTEM.

When this loss takes place it can lead to Virus attack,fraud can be achieved by harkers through the manipulation of records, intellectual property theft.

THROUGH THIS HARM THE COMPANY WILL LOSS WORK TIME, LOSS SOME AMOUNT OF MONEY AND SOME BUSINESS OPPORTUNITIES.

5 0
1 year ago
Other questions:
  • Of the following tasks, which one CANNOT be easily accomplished with a Wiki? Collaborating Social networking Editing Reading
    13·1 answer
  • Represent decimal number 8620 in (a) BCD, (b) excess-3 code, (c)2421 code, and (d) as a binary number
    7·1 answer
  • In three to five sentences, explain how you would insert graphics using your word-processing software.
    7·2 answers
  • Given a scanner reference variable named input that has been associated with an input source consisting of a sequence of strings
    14·2 answers
  • Assume the input data is structured as follows: first there is a non-negative integer specifying the number of employee timeshee
    9·1 answer
  • Write a function string middle(string str) that returns a string containing the middle character in str if the length of str is
    13·1 answer
  • If the input is negative, make numItemsPointer be null. Otherwise, make numItemsPointer point to numItems and multiply the value
    9·1 answer
  • If a class has member variables that are pointers, you must ensure that you implement ____.
    6·1 answer
  • In below freezing conditions, keep your fuel level at least _________ full to keep moisture from freezing in your gas line.
    13·1 answer
  • A chain of dry-cleaning outlets wants to improve its operations by using data from
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!