Computers and Technology

Im trying to get my code to go through the If Loops multiple times, but it only goes through them the initial run. Does anyone what loop I should use to loop the if loops? here is my code:
import turtle as trtl
import random as rand

#import files (i=images, background, etc.)
patient_image = "patient. gif"
bloody_patient = "bloody patient. gif"
sick_patient = "Sick patient. gif"
#define variables here (endpoint of the patients, background dimensions)
screen_width = 400
screen_height = 400
patient_list = [patient_image, bloody_patient, sick_patient]
random_patient = rand. choice(patient_list)

#maybe for later use to put patients in line
'''front_line = (50 , 0)
second_line = (100 , 0)'''

'''current_patient = "." '''

wn = trtl. Screen()
wn. setup(width=.5, height=.5)
wn. tracer(False)
wn. addshape(patient_image)
wn. addshape(bloody_patient)
wn. addshape(sick_patient)

patient = trtl. Turtle()
patient. penup()
wn. tracer(False)

def draw_patient(patient, random_patient):
'''global random_patient'''
print ("inside draw patient " + random_patient)
'''random_patient = rand. choice(patient_list)'''
patient. penup()
patient. goto(400,0)
patient. shape(random_patient)
patient. showturtle()
wn. update()
print ("exiting draw patient")

def cure_patient():
wn. tracer(True)
random_patient = rand. choice(patient_list)
if (random_patient == patient_image):
print ("random patient = patient image")
if (random_patient == sick_patient):
print ("random patient = sick patient")
if (random_patient == bloody_patient):
print ("random patient = bloody patient")

print ("inside cure patient " + random_patient)
'''global random_patient'''

patient. goto(-100,-100)
patient. clear()
patient. hideturtle()
wn. tracer(False)
draw_patient(patient, random_patient)
print ("exiting cure patient")

print ("calling draw patient function")
draw_patient(patient, random_patient)
print ("finish draw patient function")

while

print ("if statement comparing random patient to patient")
if (random_patient == patient_image):
print ("inside if statement of patient image")
wn. onkeypress(cure_patient,"a")
print ("random patient = patient image / press the A key")

print ("if statement comparing random patient to sick patient")
if (random_patient == sick_patient):
print ("inside if statement of sick patient image")
wn. onkeypress(cure_patient,"s")

print ("random patient = sick patient / press the S key")

print ("if statement comparing random patient to bloody patient")
if (random_patient == bloody_patient):
print ("inside if statement of bloody patient image")
wn. onkeypress(cure_patient,"d")
print ("random patient = bloody patient / Press the D key")

print ("entering listen")
wn. listen()
print ("entering mainloop")
wn. mainloop()

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 15:00, cia196785920
Look at the circuit illustrated in the figure above. assume that the values of r1 and r2 are equal. if you connect your meter’s test probes to points a and b in the circuit, which of the following voltages would you measure
Answers: 1
image
Computers and Technology, 24.06.2019 00:30, sethhdoty
Use the keyword strategy to remember the meaning of the following word. the meaning for the word has been provided. write your keyword and describe the picture you would create in your mind. obfuscate: to make something so confusing that it is difficult to understand.
Answers: 2
image
Computers and Technology, 24.06.2019 12:30, tragicteekaay
Nikki sent flyers in the mail to all houses within the city limits promoting her computer repair service what type of promotion is this and example of
Answers: 1
image
Computers and Technology, 24.06.2019 15:40, elgallo5399
In the above figure, what type of cylinder arrangement is shown in the figure above? a. l-type b. v-type c. in-line d. horizontal pls make sure its right if its rong im grounded for 3months
Answers: 1
Do you know the correct answer?
Im trying to get my code to go through the If Loops multiple times, but it only goes through them th...

Questions in other subjects: