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

9.3 Code Practice

Computers and Technology
2 answers:
Softa [21]3 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]3 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
Recursion occurs when a function (calls itself/ calls another function/ calls a function from the python standard library)
lesantik [10]

Answer:

Recursion is calling of a function from within that same function

5 0
3 years ago
The color gradient is
Kipish [7]
A range of position dependent colors
8 0
3 years ago
5.2
Ray Of Light [21]

Answer:

In order to reduce the risk of accidents on the roads.

Explanation:

The special equipment is used when  testing eyesight for a driver's license in order to reduce the risk of accidents on the roads. Good eyesight is very important for good and safe driving so to find out the eyesight of the driver, the license officer used special equipment in order to check driver's eyes. If the eyesight is good, the officer provide license to the person otherwise not so that no accidents happen on the road.

8 0
3 years ago
if you want to present slide to fellow student or co-workers, wich productivity software should you use to create them?
Reika [66]
Microsoft PowerPoint
6 0
3 years ago
Megan was employed by a large company. Her supervisor told her to falsify government reports. She refused and was fired. She sue
Ber [7]

Answer: Option(d) is correct option

Explanation:

At-will employment is the employment in contractual manner in which employer can fire employee without any warning or indication .They can fire employee for any cause .

  • According to the question, even though Megan was hired at at-will employment base ,she does not persist much right over the company but she should not be dismissed for not performing illegal act as the reason for getting fired.This is a unfair and illegal manner of firing.
  • Other options are incorrect because employer was not correct on firing her because of loyalty duty or based on legal right or with just reason.Thus, the correct option is option(d)
7 0
3 years ago
Other questions:
  • The device that links computers via communication lines is called the:
    15·1 answer
  • How might writing an online journal be different than writing in a paper one ​
    15·2 answers
  • A company uses the account code 669 for maintenance expense. However, one of the company's clerks often codes maintenance expens
    15·1 answer
  • What can be said about the equipment used by photographers during the Civil War?
    13·2 answers
  • Write a program to randomly fill an array of float of 10 elements (use the rand() function and make sure to use #include ) in ma
    11·1 answer
  • Classify the various scenarios in a web development team that is creating a website for a client according to the priority level
    9·1 answer
  • Clarice is an architect who is involved in design work on a restaurant in a building that used to be part of the city’s water wo
    8·1 answer
  • Define the instance method inc_num_kids() for PersonInfo. inc_num_kids increments the member data num_kids. Sample output for th
    6·1 answer
  • What are the disadvantages of using grid analysis to help make decisions?
    13·2 answers
  • It is a data being transported on a network​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!