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
_____________are where you get down to business and enter data in a worksheet
rewona [7]

Answer:

cells are where you enter data on a eorksheet

3 0
3 years ago
If i don't update my computer what threat does my computer face?
Nadusha1986 [10]
Hey there! Hello!

Computer updates, especially smaller security updates, contain security information for new bugs, malware, viruses, etc. that have been written since your last update. So many of these are written for computers at any given time, meaning that keeping your computer updated is a significant step in keeping your computer's defense systems working. Paired up with legit anti-malware, virus protection software, good computer knowledge, and common sense, your computer can remain very safe from these viruses. 

Otherwise, there might be some bug or irregularity within your computer's system itself that was accidentally released an update or two ago by the creators of your computer's software, which may also pose a threat for your computer system. Updating your computer can most likely fix problems like these. But, more commonly, they just keep your computer up to date on the vicious computer threats that are now available for it since the previous update. 

Hope this helped you out! Feel free to ask me any additional questions if you have any. :-)

8 0
4 years ago
Frank listed the steps for attaching a file to an e-mail. Step 1: Create the message. Step 2: Click Attach File in the Include g
bija089 [108]
Which best describes Frank’s error?
Step 3 should be done before Step 2.
3 0
4 years ago
Read 2 more answers
How should work be allocated to the team in a Scrum project?
Mkey [24]

Answer:

In a Scrum project, the work or the tasks are not allotted specifically. The Scrum Master is not allowed to assign tasks to the team members under any circumstance. Once the client provides the details regarding their requirements in detail, the tasks are distributed based on the expertise and skills of the employee.

Explanation:

4 0
3 years ago
True or false. A common interpretation for a non-visit-in-person entity query can have a fully meets rating.
Aloiza [94]
The answer is false but i may be wrong
7 0
4 years ago
Read 2 more answers
Other questions:
  • Write a function named "json_filter" that takes a JSON formatted string as a parameter in the format of an array of objects wher
    15·1 answer
  • Write a program to find and print the sum of the first n cubes in the following four ways.
    12·1 answer
  • CJ is developing a new website blogging about cutting-edge technologies for people with special needs. He wants to make the site
    8·1 answer
  • You are the senior nurse on the unit and you are orienting a new graduate LVN/LPN. One of the subjects you want to cover today i
    5·1 answer
  • How long Will it take me to master scada and plc programming?​
    9·1 answer
  • Achieves integration through several different types of software that sit between and provide connectivity for two or more softw
    11·1 answer
  • Fitbit is an example of....
    15·2 answers
  • What is the default view when you first open a PowerPoint presentation
    10·1 answer
  • Binary is used to store what on a computer?<br> •Data<br> •Dates<br> •Address
    13·2 answers
  • How tractors are controlled
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!