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
Write the line of code to calculate the area of a circle with radius 3 and store it in a variable called
zloy xaker [14]

Answer:

area = 2.14 * 3 ** 2

Explanation:

No clue what language you use but this should be pretty universal. To find the area of a circle you use pi(r) ^ 2 or pi times radius squared

\pi r^{2}

In python it looks like this:

>>> area = 3.14 * 3 ** 2

>>> print(area)

28.26<em> <Printed text</em>

3 0
2 years ago
Computer design replaced ______________
bazaltina [42]
<span>Computer design replaced (B) models draw or created by hand. Technology nowadays has a big contribution in terms of planning and designing a building or a structure without burning your eyebrow facing that paper and handling your pen. Computer designs are used to make the design more accurate and more precise compared to traditional hand drawn designs.</span>
8 0
3 years ago
How do you start using the Internet?
fgiga [73]

Answer:

it's

D. open web browser

3 0
2 years ago
Read 2 more answers
How to delete account on this
qwelly [4]

Answer:

Explanation:

Go and edit your profile then go on prefernces you will see that its written delete my account and that's how you delete your account on brainly.com and if you want to delete you account on phone then

Open your phone's Settings app.

Tap Accounts. If you don't see "Accounts," tap Users & accounts.

Tap the account you want to remove Remove account.

If this is the only Google Account on the phone, you'll need to enter your phone's pattern, PIN, or password for security.

Hope this helped you!

5 0
2 years ago
Read 2 more answers
What email server does Global Enterprises use?
harina [27]

Answer:

Global Enterprises uses an open source mail server called Courier.

Explanation:

6 0
3 years ago
Other questions:
  • Which of the following would be considered a strong password?
    5·2 answers
  • ____ is a special type of large, integrated system that ties together all types of a company’s activities, such as planning, man
    11·2 answers
  • What are the two main things an operating system does?
    14·1 answer
  • What is internet marketing??
    13·1 answer
  • What is the purpose of application software
    12·1 answer
  • Consider the program below: public class Test { public static void main( String[] args ) { int[] a; a = new int[ 10 ]; for ( int
    5·1 answer
  • Stephanie would like to know the average number of regular hours worked by her employees. In cell B11, create a formula using th
    8·1 answer
  • You Could Never Size Me UP! Been Doing This Sh*t A Long ⏱time
    15·1 answer
  • Anyone know how to fix black screen of death on computer​
    6·1 answer
  • A row-level trigger requires use of the _____ keywords and is executed once for each row affected by the triggering statement.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!