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
Natalija [7]
3 years ago
13

Create a script file that asks the user to input the number of rows, number of columns, and a constant integer value (may be neg

ative, zero or positive) and then creates the matrix.
Use a user-defined function to obtain the input. Check that the number of rows and number of columns is between 1 and 8 inclusive [1:8], and that the constant value IS an integer. Give the user another chance if they enter an illegal value, do not just shut down the program. You can either put the user function in the body of the main script file or create a separate file and submit it at the end of the exam in one of the fake questions. Check your program for these 2 cases:

2 rows, 4 columns, value of -77
2 rows, 6 columns, value of 13
Engineering
1 answer:
gayaneshka [121]3 years ago
3 0

Answer:

def script_input():

   chances = 2

   while chances > 0:

       global rows

       global columns

       global constant

       rows = int(input("Enter the number of rows: "))

       columns = int(input("Enter the number of columns: "))

       constant = int(input("Enter the constant: "))

       if rows > 0 and rows <= 8 and columns > 0 and columns <= 8 and \

           isinstance(constant, int):

           chances -= 2

       else:

           chances -= 1

script_input()

print(f"{rows} rows, {columns} columns, value of {constant}")

Explanation:

The python script defines a function that gets the user input of row, column and constant value variables, then the script prints out the number of rows and columns for the matrix to be created.

You might be interested in
(Architecture) Sarah is an environmental activist. She frequently conducts various programs and activities in her community to p
ddd [48]

The council from which Sarah can obtain her building certification is;

<u><em>US Green Building Council</em></u>

  • We are told that Sarah is an environmental activist because she conducts a lot of programs to advocate for clean and sustainable environment.

Now, there is a program called LEED which is an acronym for <em>Leadership in </em>

<em>Energy and Environmental Design</em> standards that is necessary for those

that want to measure the greenness of buildings.

     This <em>LEED</em> program explained above is organized by an organization in

the United States of America (USA) known as US Green Building Council

(USGBC). This program is for everyone who wants to be a certified

environmental activist and thus i t is recommended that Sarah gets her

certification here.

Read more at; brainly.com/question/24611198

5 0
3 years ago
Which items are NOT found on a
Alja [10]

Answer:

None of the above cause thats what i put

3 0
3 years ago
25 points and brainliest is it A, B, C, D
Bogdan [553]

Answer:

SIR IT IS D HOPE THIS HELPS (☞゚ヮ゚)☞☜(゚ヮ゚☜)

Explanation:

4 0
3 years ago
Read 2 more answers
A particular competition has five judges, each of whom award a score between 0 and 10 to each performer. • Fractional scores, su
Anettt [7]

Answer:

Explanation:

Lets do this in python, our function will import an array of double numbers, then it sort the array out, drop the first and last items, aka highest and lowest score. Finally, it averages the last 3 numbers by calculate the sum and divide by the number of items

def calculate_score(scores):

    scores.sort() # sort it so that the lowest is at index 0 and the highest is at last index

    drop_highest_lowest = scores[1:-1] # this will drop the lowest and highest number

    average_score = sum(drop_highest_lowest)/len(drop_highest_lowest)

    return average_score

5 0
3 years ago
What country called for a boycott of an E! late-night comedian who made offensive remarks during an Amy Winehouse segment?
olga55 [171]
I’m sry idk but I think it Canada
5 0
4 years ago
Read 2 more answers
Other questions:
  • Find the phasor form of:
    5·1 answer
  • A 356 cast aluminum test bar is tested in tension. The initial gage length as marked on the sample is 50mm and the initial diame
    9·1 answer
  • Two kilograms of oxygen fills the cylinder of a piston-cylinder assembly. The initial volume and pressure are 2 m3 and 1 bar, re
    6·2 answers
  • -1 1/6 divided by 2 1/3
    10·1 answer
  • Impact strips may be designed into a bumper cover.<br> True<br> False
    14·1 answer
  • Which of the following is a direct result of technological improvements in the music industry?
    9·2 answers
  • 1.8 A water flow of 4.5 slug/s at 60 F enters the condenser of steam turbine and leaves at 140 F. Determine the heat transfer ra
    13·1 answer
  • How does distribution add value to goods and services being sold,
    8·2 answers
  • How did technology change society in the Renaissance?
    14·2 answers
  • A pipe fitter would fabricate which one of the following systems?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!