Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
BatterScore
#Python 2.7.17 #BatterScore: demonstration of python function where dictionary is used as argument #this code is created by Rezaul Hoque on November 03,2021;contact: jewelmrh@yahoo.com #note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; def disp(batter): for s in batter: print s," scored ",batter[s]," runs" def tot(batter): total=0 for s in batter: total += batter[s] return total batter={"k": 12,"t": 20,"r": 18} disp(batter) print "Total score: ", tot(batter)
run
|
edit
|
history
|
help
0
PyLamb
Problem: Binary
Fold an array
Gardener
Max
on_off_3
epicoaosdsoasd
Problem: rstring
Chain length calculator
MPS2