Beginner in python coding (school) and need a small bit of help with final summative (G10) /u/CallMaster1832 Python Education

here’s what i need some help with:

#Q1

if question == 1:

pygame.draw.rect(WINDOW, TrumpShade, (150, 155, 595, 70),)

pygame.draw.rect(WINDOW, Black, (150, 155, 595, 70), 1)

WINDOW.blit(Q1, (160, 165))

WINDOW.blit(Q1_2, (160, 185))

if true == True:

WINDOW.blit(CORRECT, (280, 250))

Points = Points + 1

question = question + 1

true = False

false = False

if false == True:

WINDOW.blit(WRONG, (280, 250))

Points = Points + 0

question = question + 1

true = False

false = False

#Q2

elif question == 2:

time.sleep(1.5)

pygame.draw.rect(WINDOW, White, (279, 249, 275, 215),)

pygame.draw.rect(WINDOW, TrumpShade, (150, 155, 595, 70),)

pygame.draw.rect(WINDOW, Black, (150, 155, 595, 70), 1)

WINDOW.blit(Q2, (160, 165))

WINDOW.blit(Q2_2, (160, 185))

if true == True:

WINDOW.blit(CORRECT, (280, 250))

Points = Points + 1

question = question + 1

true = False

false = False

if false == True:

WINDOW.blit(WRONG, (280, 250))

Points = Points + 0

question = question + 1

true = False

false = False

everything works fine, it’s just that i want my sleep commands (which in a while loop) to activate once, because they are currently looping multiple times and it’s not registering when I click a button I have drawn. Just need a way to remove time.sleep commands from while loop. Thanks!

submitted by /u/CallMaster1832
[link] [comments]

​r/learnpython here’s what i need some help with: #Q1 if question == 1: pygame.draw.rect(WINDOW, TrumpShade, (150, 155, 595, 70),) pygame.draw.rect(WINDOW, Black, (150, 155, 595, 70), 1) WINDOW.blit(Q1, (160, 165)) WINDOW.blit(Q1_2, (160, 185)) if true == True: WINDOW.blit(CORRECT, (280, 250)) Points = Points + 1 question = question + 1 true = False false = False if false == True: WINDOW.blit(WRONG, (280, 250)) Points = Points + 0 question = question + 1 true = False false = False #Q2 elif question == 2: time.sleep(1.5) pygame.draw.rect(WINDOW, White, (279, 249, 275, 215),) pygame.draw.rect(WINDOW, TrumpShade, (150, 155, 595, 70),) pygame.draw.rect(WINDOW, Black, (150, 155, 595, 70), 1) WINDOW.blit(Q2, (160, 165)) WINDOW.blit(Q2_2, (160, 185)) if true == True: WINDOW.blit(CORRECT, (280, 250)) Points = Points + 1 question = question + 1 true = False false = False if false == True: WINDOW.blit(WRONG, (280, 250)) Points = Points + 0 question = question + 1 true = False false = False everything works fine, it’s just that i want my sleep commands (which in a while loop) to activate once, because they are currently looping multiple times and it’s not registering when I click a button I have drawn. Just need a way to remove time.sleep commands from while loop. Thanks! submitted by /u/CallMaster1832 [link] [comments] 

here’s what i need some help with:

#Q1

if question == 1:

pygame.draw.rect(WINDOW, TrumpShade, (150, 155, 595, 70),)

pygame.draw.rect(WINDOW, Black, (150, 155, 595, 70), 1)

WINDOW.blit(Q1, (160, 165))

WINDOW.blit(Q1_2, (160, 185))

if true == True:

WINDOW.blit(CORRECT, (280, 250))

Points = Points + 1

question = question + 1

true = False

false = False

if false == True:

WINDOW.blit(WRONG, (280, 250))

Points = Points + 0

question = question + 1

true = False

false = False

#Q2

elif question == 2:

time.sleep(1.5)

pygame.draw.rect(WINDOW, White, (279, 249, 275, 215),)

pygame.draw.rect(WINDOW, TrumpShade, (150, 155, 595, 70),)

pygame.draw.rect(WINDOW, Black, (150, 155, 595, 70), 1)

WINDOW.blit(Q2, (160, 165))

WINDOW.blit(Q2_2, (160, 185))

if true == True:

WINDOW.blit(CORRECT, (280, 250))

Points = Points + 1

question = question + 1

true = False

false = False

if false == True:

WINDOW.blit(WRONG, (280, 250))

Points = Points + 0

question = question + 1

true = False

false = False

everything works fine, it’s just that i want my sleep commands (which in a while loop) to activate once, because they are currently looping multiple times and it’s not registering when I click a button I have drawn. Just need a way to remove time.sleep commands from while loop. Thanks!

submitted by /u/CallMaster1832
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *