Answered You can hire a professional tutor to get the answer.

QUESTION

#Formulate a while loop, if possible, that uses a pre-stored width #and height to return a string of all of the coordinates of each #tile in the...

#Formulate a while loop, if possible, that uses a pre-stored width 

#and height to return a string of all of the coordinates of each 

#tile in the grid, in order, separated by spaces. 

import subprocess 

def template(w,h): 

  width = w 

  height = h

result = ""

  return result 

#END OF YOUR CODE 

print "For a 3x4 board," 

result = "" 

h = 0 

while h < 4: 

  w = 0 

  while w < 3: 

    result += "("+str(w)+","+str(h)+") " 

    w += 1 

  h += 1 

if template(3,4) == result or template(3,4) == result[:-1]: 

  print "you got it RIGHT!" 

  result = subprocess.check_output 

else: 

  print "we expected '" + result + "', but you got: " + str(template(3,4)) 

  result = subprocess.check_output

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question