Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python code for this question #2

Open
ayusheesimran opened this issue Jul 7, 2016 · 1 comment
Open

python code for this question #2

ayusheesimran opened this issue Jul 7, 2016 · 1 comment

Comments

@ayusheesimran
Copy link

name = raw_input("Enter file:")
if len(name) < 1 : name = "mbox-short.txt"
handle = open(name)
counts=dict()
for line in handle:
if not line.startswith('From '): continue
line = line.rstrip().split()[5]
com=line.split(":")
count=com[0]
counts[count]=counts.get(count,0)+1
for k,v in sorted(counts.items()):
print k,v

@priyapp13
Copy link

def computepay(h,r):
if h>=40:
pay=r*(40)+r11.5*(h-40)
return(pay)
hrs=input("Enter hours:")
h=float(hrs)
rate=("enter rate:")
r=float(rate)
p=computepay(h,r)
print ("Pay",p)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants