Python Forum
Clear button in calculator
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clear button in calculator
#3
You already know how to use functions, why not write functions to clear/close and call them from your if/else?

like this:

def main():
   *your calculator code*
   if something:
      clear()
   else:
      close()

def clear():
   print(" ")
   main()

def close():
   exit()

main()
Reply


Messages In This Thread
Clear button in calculator - by lucasbrino - Jan-10-2020, 09:30 PM
RE: Clear button in calculator - by jefsummers - Jan-10-2020, 10:17 PM
RE: Clear button in calculator - by t4keheart - Jan-17-2020, 04:57 PM

Forum Jump:

User Panel Messages

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