Python script not calling main function, says process finished with exit code 0 -
im using pycharm , says process finished exit code 0 without restaurant_list or after it
def main(): # make list of resturaunts resturaunteur go restaurants_list = ['mcdonalds', 'burgerking', 'wendys', 'panerabread'] print(restaurants_list) # remove expensive resturaunt list print('here restaurants in list') print(restaurants_list) # restaurant change restaurant = input('which restaurant remove?') # remove restauraunt restaurants_list.remove(restaurant) #display list print('here revised list') print(restaurants_list) if __name__ == "__main__": main()
you need add following @ end of file:
if __name__ == "__main__": main()
... call main function. make sure pycharm configured run right script.