GeorgiLukanov87

loading_bar_functions

Jun 10th, 2022 (edited)
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. def loading_bar_function(number):
  2.     div_number = number // 10
  3.     symbol = '%'
  4.     loading_bar = ['.'] * 10
  5.     print_bar = ""
  6.     for num in range(len(loading_bar)):
  7.         loading_bar.remove(loading_bar[num])
  8.         loading_bar.insert(num, '%')
  9.         if num == div_number-1:
  10.             break
  11.     string_result = ''.join(loading_bar)
  12.     if div_number < 10:
  13.         print(f"{number}% [{string_result}]")
  14.         print(f'Still loading...')
  15.     else:
  16.         print(f'100% Complete!')
  17.         print('[%%%%%%%%%%]')
  18.  
  19. number = int(input())
  20. loading_bar_function(number)
Add Comment
Please, Sign In to add comment