formatting - Python's Multiplication Function -


in python found multiplication solution useful software writing.

problem when using software, user asked question (i.e 8x2) prints command-type line (i.e 14). not user friendly , display in simpler form, common writing form (8x2). post pictures integrate question.

on right result screen, on left code itself. if have more questions please ask.

you can add dictionary operator descriptions:

op_symbols = {     add: '+',     mul: '*',     sub: '-', } 

and instead of str(op), use op_symbols[op]


Comments

Popular posts from this blog

javascript - Complete OpenIDConnect auth when requesting via Ajax -

c# - Replace text in MailItem Body -

java - Get more than One value and display it -