Hacker News new | ask | show | jobs
by eugenekolo 1243 days 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) ```

1 comments

Should be C#, though, and for just 11 steps.