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
Worksheet ranges can be turned For easy analysis
Firdavs [7]

Answer:

Worksheet ranges is a group of cells, and a value range like 25 to 340. It is used for data modeling. Like you can use it in the vlookup, Hlookup and Xlookup for looking up a column cell value in the mentioned worksheet range. Different worksheet's ranges of cells can also be used, and in any number from throughout the workbook, and that makes the analysis quite easy. Through work sheet ranges we get the control over all the cells as well as cells group. Whatever analysis we do, we do on the list of cells. And through the worksheet ranges we get the control over the cells. And thus, this is extremely useful definitely.

Explanation:

Like one worksheet range can be from top left corner to the bottom right corner. And this assigns whole worksheet as the worksheet range.

Its used in almost all the Excel formulas, and you must know it.

An example is:

Worksheets("Sheet2").Range(Cells(2, "B"), Cells(35, "B")).select

This selects the Range B2:B35 from Sheet 2.  

6 0
3 years ago
A data type consisting of numbers, letters and symbols is a _____.
LekaFEV [45]

Answer:

That's the answer

Hope it helps

#brainliest

#heart

#star

#Carryonlearning

4 0
2 years ago
Which of the following would be used to communicate an idea or concept visually? podcast transcript building design speech
finlep [7]
C, building design. Its the only visual one, the rest have to do with speaking/listening.
6 0
3 years ago
Read 2 more answers
What do we do if IOC is called on the intercom ??
laiz [17]

Answer/Explanation:

Get out of sight of the intruder

Intruder On Campus

5 0
3 years ago
Which feature should be used prior to finalizing a presentation to ensure that audience members with disabilities will be able t
grin007 [14]

Answer:

Accessibility Checker

8 0
3 years ago
Read 2 more answers
Other questions:
  • A network administrator is required to upgrade wireless access to end users in a building. To provide data rates up to 1.3 Gb/s
    12·1 answer
  • the easiest and cheapest time to alter the information system is in the ________ phase of the sdlc. a. requirements analysis b.
    8·1 answer
  • Hymter. Wants to workin The Energy career field with electrical energy
    15·1 answer
  • When sketching out your Web site you create a clear and straightforward site map that divides the Web site content into a logica
    9·1 answer
  • A posting error is:
    8·1 answer
  • Can Algorithms Be Used Again?
    8·1 answer
  • Only for study<br><br>Or open Meet and enter this code: bqa-ivfs-ach​
    11·2 answers
  • A location in memory which stores a value, the value can change as the program is running is
    12·1 answer
  • Ajdbksjdnksnsd helppp​
    11·1 answer
  • Which would be the most efficient way to store files on your computer?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!