Advertisement
Rendier

Untitled

Nov 17th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. #!/usr/bin/python3
  2. # -*- coding: utf-8 -*-
  3.  
  4. class Sandwiches():
  5.    
  6.     def __init__(self, ingredients=None):
  7.        
  8.         if ingredients:
  9.             self.ingredients = ingredients
  10.            
  11.         else:
  12.             self.basic_ingredients()
  13.        
  14.        
  15.  
  16.     def basic_ingredients(self):
  17.         self.ingredients = [
  18.             'snails',
  19.             'leeches',
  20.             'gorilla belly - button lint',
  21.             'caterpillar eyebrows',
  22.             'centipide toes'
  23.         ]
  24.        
  25.     def print_ingredients(self):
  26.        
  27.         for i in range(len(self.ingredients)):
  28.             print(str(i + 1), self.ingredients[i])
  29.  
  30. food = Sandwiches()
  31. food.print_ingredients()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement