Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin python
- #ms.py
- ###################################################
- # Employees information: #
- # #
- ###################################################
- def emp_name():
- """displaying employees name"""
- first_name = raw_input("Enter first name: ")
- second_name = raw_input("Enter second name: ")
- fs = first_name.capitalize()
- se = second_name.capitalize()
- print "Name: ", fs, " ", se
- def age_lim():
- """displaying age limiti"""
- print "This is not the age limit for workere here"
- return
- def emp_age():
- """displaying employees age"""
- age = input("Enter age: ")
- age = int(age)
- if age >= 18:
- pass
- else:
- return age_lim()
- def emp_addr():
- """ displayin employees adderess"""
- print "Enter employees address\n"
- address = raw_input()
- address = address.upper()
- print "Address: ", address
- def emp_payment(h, r):
- pay = int(h) * int(r)
- return pay
- def emp_advance_salary():
- print "Enter the post paid"
- prepay = raw_input()
- prepay = int(prepay)
- # how do i call this function without having to statically input the
- # the argument as so emp_payment(5, 2500)
- balance = emp_payment(5, 2500) - prepay
- print "Balance is :", balance
- return balance
- #emp_payment(6, 5000)
- #emp_advance_salary()
- #emp_data()
- #emp_name()
- class Bar:
- total_cost = 0
- count = 0
- def set_name(self, name):
- self.name = name
- return name
- def set_price(self, price):
- self.price = price
- return price
- def set_count(self):
- counts = Bar.count =+ 1
- print "The number of dinks: ", counts
- # still have to adjust this section
- def set_total_cost(self): #I am having some errors #calling this functions
- total = set_price() * set_count()
- print "Total cost of drinks: ", total
- pass
- bar1 = Bar()
- name = bar1.set_name("Beer")
- print name
- bar2 = Bar()
- price = bar2.set_price(500)
- print price
- bar3 = Bar()
- bar3.set_count()
- bar4 = Bar()
- bar4.set_total_cost()
- class Beer(Bar):
- def __init__(self, name, price):
- self.name = name_of_beer
- self.price = price_of_beer
- def set_name_of_beer(self):
- return self.name
- def set_price_of_beer(self):
- print "price of beer :", self.price
- def display_total_cos_of_beer(self):
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement