Python Forum
command line calculator
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
command line calculator
#2
counter = {'add': 0, 'sub': 0, 'mul': 0, 'div': 0, 'abs': 0 }


counter[operation] += 1

def report():
  for func, times in counter.iteritems():
    print "%s function: %d" % (func, times)
Reply


Messages In This Thread
command line calculator - by Zatoichi - Jan-28-2018, 04:38 AM
RE: command line calculator - by egslava - Jan-28-2018, 05:07 AM
RE: command line calculator - by Zatoichi - Jan-28-2018, 04:57 PM
RE: command line calculator - by Zatoichi - Jan-28-2018, 06:45 PM
RE: command line calculator - by egslava - Jan-28-2018, 09:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  SSL Certificate Error when trying to do command-line registration with pypi DeliriousDelight 0 2,777 Dec-06-2018, 09:38 AM
Last Post: DeliriousDelight
  Command line inputs not printing to Log File ijosefson 1 3,411 Oct-19-2017, 06:41 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020