find_item = input("Enter the item to be searched here:- ").lower() items = {'wand': 5, 'telescope': 2, 'feather pen': 7} for thing in items: if thing == find_item: print(f"{items[thing]} units of {thing} are present.") break else: print('No stock left! You need to go and buy!!')
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter