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]
4 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]4 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
Name an analog quantity other than temperature and sound
liq [111]
I know that this might be wrong but is it light?
6 0
4 years ago
Lola wants to install an add-in in Excel.She has to unblock the add-in to allow Excel to open the add-in file automatically.To d
ololo11 [35]

Answer:

The correct answer is:

Properties (D)

Explanation:

First of all, option D (Properties) is the option that makes the most sense in this scenario, because the other options: Copy, Delete, and Rename are unrelated commands to what is to be achieved.

Secondly and more practically, an add-in file may not load in excel, and most of the time it is blocked by default and has to be unblocked. The following steps are used:

1. close Excel if it is open

2. open the folder where the add-in file is located, right-click on the add-in file, and select "properties"

3. a display tray will appear, having the attributes: Read-only, Hidden, Advanced, and unblock. Click the checkbox against "unblock" and make sure it is checked.

4. click Apply and Click Ok

Voila, your add-in file is unblocked.

<em>N:B The Images are for steps 2 and 3</em>

5 0
3 years ago
Which destination ipv4 address does a dhcpv4 client use to send the initial dhcp discover packet when the client is looking for
Dima020 [189]
<span>A DHCPv4 client use the broadcast IP address to send the initial DHCP discover packet when the client is looking for a DHCP server. </span><span>
A workstation will send a DHCPDISCOVER message to start the process of obtaining a valid IP address. The client  does not know the addresses of DHCP servers, and that's why it sends the message via broadcast, with destination addresses of FF-FF-FF-FF-FF-FF and 255.255.255.255.</span>
5 0
4 years ago
What is a generic phone
Zina [86]

Explanation:

Generic Android Device means the Android devices which does not any specific brand name or they can not be related to any specific class or brand. For ex: Samsung developed Epic 4g Touch Android device but they later removed lot of fancy features and stuffs from it launched with Galaxy S.

3 0
3 years ago
Read 2 more answers
It is a good idea to include your teacher’s name on a title page.
LenaWriter [7]

Answer: I think it all depends on the teacher because I know one of my teachers like when we put their name on our assignments. So I pick true

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Which statement below correctly differentiates between frames and bits? Frames have more information in them than bits. Frames a
    10·2 answers
  • A(n) _____ is a fake online persona created to promote a particular point of view, often in praise of a firm, product, or indivi
    15·1 answer
  • This activity will help you meet these educational goals:
    7·2 answers
  • What enables computers to run multiple operating systems and multiple software applications at the same time and creates multipl
    6·1 answer
  • You can change the location of the layers panel on the screen by _____ .
    7·1 answer
  • ________ is a wireless protocol designed for transmitting data over short distances, replacing cables. ipv6 ipv4 paas bluetooth
    11·1 answer
  • When a person or organization uses the services of another professional, that person or organization is called the _______
    15·1 answer
  • How do ACLs work on a router?
    14·1 answer
  • What is the function of the NOS? Select all that apply.
    5·2 answers
  • How many passes will it take to find the five in this list?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!