{"push_id":679037608,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"0d2917114bf3c5e259443b464f27251631e63e8a","before":"2bad7d105086a30f30081e083bf5617b1af2be30","commits":[{"sha":"0d2917114bf3c5e259443b464f27251631e63e8a","author":{"email":"d1303b5577896b02ee0ba548b07abb15767d6471@gmail.com","name":"Estevan Adrian Pequeno"},"message":"refactoring for nana fredua-agyeman\nDear Steve\nI'm sorry to be bothering you. I'm a Ghanaian and 34 years. I've just started learning python from the book Python for Informatics. In Chapter Five, a question appeared which I had been struggling with. Below is my code\n\nc=0\nt=0\nwhile True:\n    input=raw_input('Enter a Number: ')\n    if input=='done':\n        break\n    float(input)\n    t=float(input)+t\n    c=c+1\n    try:\n        if float(input) is not int is not float or input is not 'done':\n            continue\n    except:\n        print 'Invalid Data'\nprint t,c,t/c\n\nHowever, this fails when a string is entered first. Also, it works somewhat well in codeskulptor but not in the interactive mode.\n\nWhile surfing on the net, I saw your solution but you used 'global' to arrive at the answer. My worry, is since 'global and local' variables have not been mentioned from chapters 1 to 5, I thought the solution should have only tools that have been give us.\n\nIs there any other way to achieve your results?\n\nthanks","distinct":true,"url":"https://api.github.com/repos/epequeno/python-for-informatics/commits/0d2917114bf3c5e259443b464f27251631e63e8a"}]}