Answer:
import random
Explanation:
Using the random module in python you could generate a random number.
Answer:
Explanation:
Let's do this in python. First we can set a placeholder variable to hold the first element of the array, then we can set that first element to the last element (5th) of that array. Then we set the last element of that array to the placeholder, which has value of the original first element of the array
placeholder = boroughs[0] # in python, 0 is the first element or arra
boroughs[0] = boroughs[-1] # -1 means the last element of the array
boroughs[-1] = placeholder
Answer:
print(total) => 45
Explanation:
# smells like Python...
val = 0 #initialize incrementor named 'val' at 0.
total = 0 #initilize accumulator named 'total' at 0.
while (val < 10): #look to execute while val is less than 10.
val = val + 1 #increment val (val++) by 1
total = total + val #increment total by val (val+=total)
# Step: val = 0
## val => 1, total => 1
# Step: val = 1
## val => 2, total => 3
# Step: val = 2
## val => 3, total => 5
# Step: val = 3
## val => 4, total => 9
# Step: val = 4
## val => 5, total => 14
# Step: val = 5
## val => 6, total => 20
# Step: val = 6
## val => 7, total => 27
# Step: val = 8
## val => 9, total => 36
# Step: val = 9
## val => 10 (END_LOOP), total => 45
print(total) #print variable 'total'