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
Museum web sites are generally good resources for information.<br> A.) True<br> B.) False
Hatshy [7]
True. Museums usually specialize in one area in specifics.

Ex. WWII Museums give great historical info on WWII
8 0
3 years ago
Read 2 more answers
How to create json object from variables javascript
tino4ka555 [31]
Not entirely sure what you want to achieve, but consider this program:

var a = 'foo';
var b = 'bar';

var c = { first : a, second : b };

console.log(JSON.stringify(c, null, 4));

A json object c is constructed using the values from variables a and b. Is this what you mean?
8 0
3 years ago
Formatting commands can be used to add number formats? True of false
Aleks04 [339]

Answer:

false

Explanation:

3 0
3 years ago
What is a key consideration when evaluating platforms?
kotegsom [21]

Answer:

The continuous performance of reliability data integrity will lead to the benefit and profit of the platform's regular structure changes. Cleanliness in the platform whereas addresses the straightforward structure of task performance and adequate data integrity.

7 0
3 years ago
In an all-integer linear program,
xenn [34]

Answer: E

All decision variables must be integer

Explanation:

The integer-linear program is a program in which the objective function and any constraints are all linear ie all of the variables are restricted to be integers.

A linear program is Np complete. Also every decision variable appear in any constraints must also appear in the objective function, possibly with zero coefficient if needed.

8 0
3 years ago
Other questions:
  • Read three integers from user input. Then, print the product of those integers. Ex: If input is 2 3 5, output is 30. Note: Our s
    6·1 answer
  • What is the purpose of lookup tables in spreadsheet software
    13·2 answers
  • Heelo how do u do python syntax lesson 11 on code academy
    12·1 answer
  • • The technical support department at your company has informed you that you will be receiving a new computer within the next we
    6·1 answer
  • The primary reason for the creation of the Federal Reserve System LOADING... ​was: A. to create a single central bank similar to
    7·1 answer
  • A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To ac
    14·2 answers
  • A client calls to complain that his computer starts up, but crashes when Windows starts to load. After a brief set of questions,
    13·1 answer
  • give the difference between functional and functional tools in the middle of to the circle give importance​
    10·1 answer
  • How do you loop a makebeat in earsketch
    11·1 answer
  • Jak sie pisze oł na klawiaturze komputerowej
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!