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
Can someone help me on a 60 second ringtone :(
Lesechka [4]

Answer:

If you have an apple phone, its as easy as importing it into Garage Band, cutting it to size, and exporting it as a ringtone or even a text tone. My text tone is now Megalovania.

5 0
3 years ago
What is company NDR?​
lina2011 [118]

Answer:

Explanation:

NDR is a multinational American based company with international branches in Thailand, Cambodia, and Myanmar in the telecom industry and media with sales of over US$100 Million. The company develops application store (APP Store) and application (APP) for mobile devices with 700,000+ apps in the app store.

7 0
3 years ago
Which member of the Jackson family was the spokesperson for the Psychic Friends Network.​
Jlenok [28]

Answer:

La Toya Jackson

Explanation:

8 0
3 years ago
V.kofiryfh givnyovb (to slove you must go back 3 letters)
Elena L [17]
Im goin to be honest with you i dont understand this question at all can you xplain it alittle more plz cuz if i go back three letters it is o
7 0
3 years ago
Makes it possible to treat dates as other numbers
Vera_Pavlovna [14]
What do you mean?  <span>Makes it possible to treat dates as other numbers</span> 
8 0
3 years ago
Other questions:
  • Brad teaches an accounting class, and he created a PowerPoint presentation from a Word outline for his class. This Word outline
    14·1 answer
  • PLS HELP GIVING 100 POINTS TO THE PERSON WHO WRITES IT
    6·1 answer
  • As it is a good practice that C# broughtback the concept of GOTO statement and Pointer? If your answer isyes then how C# control
    15·1 answer
  • Which of the following are ways companies gather customer feedback?
    13·2 answers
  • I’m turning my Pinterest into a professional account what should be my user name please try to think of a good name and not just
    11·2 answers
  • • Suppose an application generates chunks of 40 bytes of data every 20 msec, and each chunk gets encapsulated in a TCP segment a
    5·1 answer
  • Which programming element is used by a game program to track and display score information?
    10·2 answers
  • What is the name of the image window area that allows you to determine if a line is truly horizontal or vertical
    7·2 answers
  • Ok answer me this who do you like better sans or paapyrus? If its another au say wich one P.S. I picked computers bc its a game
    14·1 answer
  • What is computer forensics? Where and how would an IT auditor use thisresource?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!