4 ms·
This one's pretty fancy from the big GPT. ``` Here is an example of Python code that can print a loading bar at different completion percentages: def print_lo
by eugenekolo 4y ago
This one's pretty fancy from the big GPT.
```
Here is an example of Python code that can print a loading bar at different completion percentages:
def print_loading_bar(percent):
bar_length = 20
hashes = '#' * int(percent * bar_length / 100)
spaces = ' ' * (bar_length - len(hashes))
print(f'\rLoading... [{hashes}{spaces}] {percent}%', end='')
for i in range(101):
print_loading_bar(i)
time.sleep(0.1)
```
- tgv 4y agoShould be C#, though, and for just 11 steps.