'I want to print something only once in a while loop and if I change the string while running the file it would work in python
Code:
while True:
text = 'fizz'
if text == 'fizz':
print('fizz')
elif text == 'buzz':
print('buzz')
I want to print fizz once if text = 'fizz' and if I replace text = 'fizz' with text = 'buzz' while the file is running it still prints buzz.
Is this possible and how to do it if it is?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
