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
Readme [11.4K]
3 years ago
13

We will pass in 2 values, X and Y. You should calculate XY XY and output only the final result. You will probably know that XY X

Y can be calculated as X times itself Y times. # Get X and Y from the command line:import sysX= int(sys.argv[1])Y= int(sys.argv[2])# Your code goes here
Computers and Technology
1 answer:
kiruha [24]3 years ago
5 0

Answer:

import sys

# The value of the second argument is assigned to X

x = int(sys.argv[1])

# The value of the third argument is assigned to Y

y = int(sys.argv[2])

# The result of multiplication of x and y is assigned to 'result'

result = x * y

#The value of the result is displayed to the user

print("The result of multiplying ", x, "and ", y, "is", result)

Explanation:

First we import sys which allow us to read the argument passed when running the program. The argument is number starting from index 0; the name of the python file been executed is sys.argv[0] which is the first argument. The second argument is sys.argv[1] and the third argument is sys.argv[2].

The attached file is named multplyxy (it wasn't  saved as py file because the platform doesn't recognise py file); we can execute it by running: python3 multiplyxy.py 10 23

where x will be 10 and y will be 23.

To run the attached file; it content must be saved as a py file: multiplyxy.py

Download pdf
You might be interested in
What are some benefits that each computer system being used?
lisabon 2012 [21]

Answer:

Computerised accounting systems have numerous benefits to them and below are the top nine points as to why you should be using them with your business.

Automation. ...

Data Access. ...

Accuracy. ...

Reliability. ...

Speed. ...

Security. ...

Scalable. ...

Visuals.

Explanation:

hope this helps!

6 0
2 years ago
Read 2 more answers
What Two external audio recorders are most commonly used ??
zimovet [89]

Answer:

Very few recorders have built-in microphones that are useful for field reporting. Does the recorder have XLR (professional grade) input, Tip-Ring Sleeve (TRS) input or just a mini jack? Format – There are two types of audio files: compressed and uncompressed. Cheap audio recorders will compress all of the audio it captures.

Explanation:

hope this helps mark as brainiest.

3 0
3 years ago
How could the following line of code be shortened?
Alinara [238K]

Answer:

2

Explanation:

The second option is the only one that will work. The last would work but doesn't make the code any shorter.

8 0
2 years ago
Discuss how the use of digital formats for audio-visual recording and editing has
Zolol [24]

Answer:

Digital formats allow for lossless data storage, fast editing (without the loss of original source material, ie having to manually clip pieces of film), and made collaboration easier.

4 0
3 years ago
What is the importance of technology in your life?Explain.
Ghella [55]

technology has been very important in my life because, it helps me with my daily struggles, helps with stress (social media), makes everything easier, also creates a more efficient way of learning and much more.

although this should be answered with your own thoughts and opinions, I provided mine if in any case that it helps

8 0
3 years ago
Other questions:
  • Recall that book ciphers do not necessarily require a full book to decode, but instead any written text, such as the Declaration
    6·1 answer
  • What is occurring when an attacker manipulates commonplace actions that are routinely performed in a business?
    6·1 answer
  • why do programs include keyboard shortcuts for certain actions? do you prefer the mouse or the keyboard/ why?
    7·1 answer
  • It is safe to stand on the top step of a ladder provided it is braced property
    10·1 answer
  • In cell G6, use the appropriate lookup and reference function to retrieve the rental rate from the named range RentalRates. The
    15·1 answer
  • An
    9·1 answer
  • Write the definition of a function that takes as input the three numbers. The function returns true if the first number to the p
    12·1 answer
  • Suppose that we want to multiply 500 matrices and we use the optimal parenthesization computed by the MATRIX-CHAIN-ORDER functio
    13·2 answers
  • Why is a computer called"a computer"?​
    12·2 answers
  • balance exercises used for introducing balance training should initially involve little joint motion and improve what type of co
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!