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
vodka [1.7K]
3 years ago
5

python Given num_rows and num_cols, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E.

Print a space after each seat, including after the last. Ex: num_rows = 2 and num_cols = 3 prints: 1A 1B 1C 2A 2B 2Cnum_rows = 2num_cols = 3# Note 1: You will need to declare more variables# Note 2: Place end=' ' at the end of your print statement to separate seats by spaces

Engineering
1 answer:
MissTica3 years ago
3 0

Explanation:

First of all get the input from the user, number of rows and number of columns where rows represents seat digit number and column represents the seat letter

rows is initialized to 1 to ensure that row starts at 1 or you can remove it then seat number will start from 0.

The first loop is used for digits starting from 1 to number of rows

The second loop is used for letters starting from 1 to number of columns

since rows and cols are not of the same type that's why we are converting the int type to string type

print(str(rows)+cols) counter will keep updating the columns A, B, C.....

rows= rows + 1 counter will keep updating the rows 1, 2, 3....

Code:

Please refer to the attached image.

Output:

Please enter the number of rows: 2

Please enter the number of columns: 3

1A

1B

1C

2A

2B

2C

You might be interested in
Write a program that asks the user to input a vector of integers of arbitrary length. Then, using a for-end loop the program exa
ELEN [110]

Answer:

%Program prompts user to input vector

v = input('Enter the input vector: ');

%Program shows the value that user entered

fprintf('The input vector:\n ')

disp(v)

%Loop for checking all array elements

for i = 1 : length(v)

   %check if the element is a positive number

   if v(i) > 0

       %double the element

       v(i) = v(i) * 2;

   %else the element is negative number.

   else

       %triple the element

       v(i) = v(i) * 3;

   end

end

%display the modified vector

fprintf('The modified vector:\n ')

disp(v)

4 0
3 years ago
9. Imagine that you're performing measurements on a circuit with a multimeter. You measure a total circuit
ratelena [41]

Answer:

C

Explanation:

the total resistance is equal to the total potential difference divided by the Current

3 0
2 years ago
Read 2 more answers
To ensure that a vehicle crash is inelastic, vehicle safety designers add crumple zones to vehicles. A crumple zone is a part of
spin [16.1K]

Answer:

Explanation:

Answer: With crumple zones at the front and back of most cars, they absorb much of the energy (and force) in a crash by folding in on itself much like an accordion. ... As Newton's second law explains force = Mass x Acceleration this delay reduces the force that drivers and passengers feel in a crash.Sep 30, 2020

5 0
3 years ago
Write a function named "total_population" that takes a string then a list as parameters where the string represents the name of
adelina 88 [10]

Answer:

Return the total population of all cities in the list.

Explanation:

It is for every element in cityinfo. It works not only for one array but multiple.

I attached the document with the code or function with the name import cvs becuase when I wrote it down and it sent a message written on red about inappropriate words.

Download docx
5 0
4 years ago
According to OSHA standards, the air in the building that John works in is unsafe. The type of regulation that OSHA engages in i
ioda

Answer:

social regulation.

Explanation:

Social regulation are rules set aside to protect the environment or restrain activities that poses threat to public health and safety, examples includes environment pollution which includes lands, air, water etc, unhealthy work environment, etc. This rules identify activities that are allowed or under sanction for individuals, firms and government, breaking this rules most times comes with heavy fines or sanctions.

Social regulation help to see to the safety and well being of our environment, it serves as a guide for human activities.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Practicing new things strains your brain fibers, weakening your ability to make connections.
    13·1 answer
  • More discussion about seriesConnect(Ohm) function In your main(), first, construct the first circuit object, called ckt1, using
    10·1 answer
  • A PV battery system has an end-to-end efficiency of 77%. The system is used to run an all-AC load that is run only at night. The
    11·1 answer
  • In order to build a skyscraper Builders, Inc. hires 400 construction workers and 50 managers. Builders, Inc. represents A entrep
    8·1 answer
  • Compared to arc welding, which of the following statements are true about<br> gas welding?
    13·1 answer
  • 2.31 LAB: Simple statistics Part 1 Given 4 integers, output their product and their average, using integer arithmetic. Ex: If th
    5·2 answers
  • When using fall arrest, free fall must be kept at or below how many feet
    13·1 answer
  • The driver should be able to see the ground within _____ to the front?
    14·1 answer
  • A 75-hp motor that has an efficiency of 91.0% is worn-out and is replaced by a motor that has a high efficiency 75-hp motor that
    6·1 answer
  • 5. A 15-nC point charge is at the origin in free space. Calculate V₁ if point P, is located at
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!