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
postnew [5]
2 years ago
13

9.3 Code Practice

Computers and Technology
2 answers:
Softa [21]2 years ago
7 0

Answer:

import random

numbers = []

for r in range (4):

   numbers.append([])

for r in range(len(numbers)):

   for c in range(5):

       numbers[r].append(random.randint(-30,30))

for r in range(len(numbers)):

   for c in range (len(numbers[0])):

       print((numbers[r][c]), end = " ")

   print("")

Explanation:

ok

julsineya [31]2 years ago
5 0

Answer:

import random

def grid_maker(x, y):

   return [ [str(random.randint(-30, 30)) for _ in range(x)]for _ in range(y) ]

print ('\n'.join(' '.join(row) for row in grid_maker(4, 5)))

Explanation:

We use a template function and we generate numbers between -30 and 30:

>>> [str(random.randint(-30, 30))]

We also use the str() method so we can later concatenate the integers with \n. If you do not specify the integers, it will cause a crash. Also, keep in mind if we use a variable to store the integers, it will come out more of like a seed than a random grid. For instance, output without the random integers in a variable:

-12 16 -18 -3

7 5 7 10

18 -21 -16 29

21 3 -4 10

12 9 6 -9

Vs with a variable:

-25 6 -25 -20

-25 6 -25 -20

-25 6 -25 -20

-25 6 -25 -20

-25 6 -25 -20

Next we specify the  x and the y:

>>> for _ in range(x)]for _ in range(y) ]

Next we just print it and create a new line every time a row is made

hope this helped :D

You might be interested in
Which cell address indicates the intersection of the first row and the first column in worksheet?
Rzqust [24]

Answer:

A. A1

Explanation:

Worksheet's Columns are named with Alphabets. i.e. A,B,C,D,E....

And Worksheet's rows are named with numbers. i.e. 1,2,3,4,5....

So the intersection of first row number as "1" and First Column name as "A" is A1 as worksheet displays column name first and then row number.

8 0
3 years ago
Read 2 more answers
Name two different ways you can bring up the my computer folder
sweet [91]

The My Computer folder is a multipurpose tool and is a gateway to all the data stored in the computer. This folder sits at the top of your laptop or PC. It can be found on your computer’s desktop, on the start menu and within the windows explorer. <u>Clicking or double clicking on these options will bring up the My Computer folder. </u>

<u>Another easier way of doing this is to hold down the windows + E combination keyboard keys.</u>

7 0
3 years ago
Read 2 more answers
A(n) ______ is system software.
arsen [322]
System software<span> is a type of computer program that is designed to run a computer's hardware and application programs. If we think of the computer </span>system <span>as a layered model, the </span>system software<span> is the interface between the hardware and user applications</span>
7 0
3 years ago
The leader in student travel who provides educational tours at affordable prices is called?
jenyasd209 [6]

Answer:

Juniour tours

Explanation

Juniour tours provide exceptional travel experience for their students in the educational travel market. They normally have customized packages that are usually customized and very affordable for the students. It offers tour escorts, food and accomodations, and round trip transportation.

3 0
2 years ago
Describe a strategy for avoiding nested conditionals. Give your own example of a nested conditional that can be modified to beco
Alina [70]

Answer:

plz like and rate and mark for brainlist

Explanation:

Give your own example of a nested conditional that can be modified to become a single conditional, and show the equivalent single conditional. Do not copy the example from the textbook. The best strategy for avoiding nested conditionals is to use logical operators like: and, or, not.

8 0
3 years ago
Other questions:
  • ________ are viruses that masquerade as useful programs or files. hydras spyware programs worms adware programs trojan horses
    6·1 answer
  • The Table Tools tab provides which two additional tabs?
    5·1 answer
  • Una bombilla de 40 w de potencia está encendida durante 10 horas. Calcular la energía que ha consumido en julios y en kw·h.
    12·1 answer
  • A smart phone is always a _____.<br> client<br> server<br> network<br> process
    10·1 answer
  • Which command is not one of the available Change Case options?
    8·1 answer
  • ___ is a family of data formats that helps people automatically receive feeds anytime there are new postings to their favorite b
    14·1 answer
  • Analyze the following code:
    8·1 answer
  • What is motivation and state the two forms​
    14·1 answer
  • For the sake of maximizing hardware utilization in a multicore system with a many to many threading model, the relationship of t
    12·1 answer
  • What is the sequence of instructions performed to execute one program instruction
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!