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
Is there a way to search your computer for all music files on it?
Slav-nsk [51]
Yes their is a way go to your downloads see if you have some thing or their shall be something that you can type in your computer and find something or you can go to Youtube or google and they can show you a video or some articles.
5 0
3 years ago
Please answer questions in complete sentences!
Troyanec [42]

i need help on that too :cc

7 0
2 years ago
The software that requests mail delivery from the mail server to an Internet device is known as mail ____ software.
OleMash [197]

The software that requests mail delivery from the mail server to an Internet device is known as mail client software.

Explanation:

Mail client software is a form of communication in which electronic messages are created and transferred between two or multiple devices connected to a network series or stream.

8 0
2 years ago
Personal letterheads are created in the Footer of a document.
Alex_Xolod [135]
The answer is false .

The letterhead is organized with appropriate information on the top and bottom of the letter with most of the space left to enter the letter contents.

hope this helps.
6 0
3 years ago
The scheme where you can find the greatest common divisor of two integers by repetitive application of the division algorithm is
gavmur [86]

Answer:

False

Explanation:

The scheme where you can find the greatest common divisor (GCD) of two integers by repetitive application of the division algorithm is known as Euclidean Algorithm.

The Euclidean Algorithm for calculating GCD of two numbers X and Y can be given as follows:

  • If X=0 then GCD(X, Y)=Y since the Greatest Common Divisor of 0 and Y is Y.
  • If Y=0 then GCD(X, Y)=X since the Greates Common Divisor of 0 and X is X.
  • Let R be the remainder of dividing X by Y assuming X > Y. (R = X % Y)
  • Find GCD( Y, R ) because GCD( X, Y ) = GCD(Y, R ).
  • Repeat the above steps again till R = 0.

4 0
3 years ago
Other questions:
  • How is a cell named?
    9·1 answer
  • Give any 3 examples of mainframe computers .
    10·1 answer
  • Which type of connection is needed to synchronize data with a cloud service?
    8·1 answer
  • Joe always misspelled the word calendar what function corrects the word
    12·2 answers
  • We already know that we can create a lunar lander application of the pipe-and-filter architecture style from three independent J
    6·1 answer
  • John travels a lot and he needs to access his documents and services on the go. Which of these technologies allows his to access
    5·1 answer
  • Kelly is a college sophomore majoring in computer science. She is interested in gaining exposure to the most useful and current
    13·1 answer
  • The dns server translates the URL into the IP address 8.8.8.8. What is the next step in the process?
    11·1 answer
  • How do you remove a key cap without a kaycap remover (keyboard keycap) ​
    11·1 answer
  • Discuss the ways you can perform to prevent your computer/device and its data/contents from being stolen. Define two-facto authe
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!