-1

I want to add a counter to this code so every time the word ligma is printed it counts the number of times ligma was printed on the screen

import winsound
import time
from threading import Thread

def play_sound():
    for _ in range(10):
        winsound.PlaySound("dank", winsound.SND_ALIAS)
        time.sleep(2.5)

thread = Thread(target=play_sound)
thread.start()

while True:
    print ('ligma')
    time.sleep(1.5)
sacuL
  • 49,704
  • 8
  • 81
  • 106

1 Answers1

1
count = 0
while True:
    print ('ligma')
    count += 1
    time.sleep(1.5)
mindfolded
  • 216
  • 1
  • 8