+ 3

How will i get output, help me to find my mistake because simple code i will able to do but find difficult to compute the output

def batscore(d): name=d.get('name') runs=d.get('runs') balls=d.get('balls') batscore=int(runs/2) four=d.get('4') six=d.get('6') batscore=int(runs/2) if batscore>=50: batscore+=2 if batscore>=100: batscore+=10 if runs>0: sr=runs*100/balls if sr>=80 and sr<100: batscore+=2 if sr>100: batscore+=4 batscore=batscore+four batscore=batscore+2*six return{'name':name,'batscore':batscore} https://code.sololearn.com/c1amcWk081VQ/?ref=app https://www.sololearn.com/discuss/2153738/?ref=app

1st Feb 2020, 7:22 AM
Utsav Singh
Utsav Singh - avatar
13 Respostas
+ 3
Can you write this program on Sololearn Playground?
1st Feb 2020, 7:33 AM
AÍąJ
AÍąJ - avatar
+ 3
Oma Falk thanks again bro😊 I found my mistake and i will definately upload more codes and try to practice hard and thanks for your kind helping😊
1st Feb 2020, 7:56 AM
Utsav Singh
Utsav Singh - avatar
+ 3
Thank you so muchValerii Mamontov
1st Feb 2020, 5:49 PM
Utsav Singh
Utsav Singh - avatar
+ 3
SACKITEY ELIJAH DAVID Please dont post questions under other peoples question. Post your own for that.
2nd Feb 2020, 7:58 AM
Oma Falk
Oma Falk - avatar
1st Feb 2020, 7:45 AM
Oma Falk
Oma Falk - avatar
+ 2
Oma Falk Not found funny😕 It takes time bro but i'm trying that is enough for me
1st Feb 2020, 7:46 AM
Utsav Singh
Utsav Singh - avatar
+ 2
Utsav Singh first time it is always a bit hard. look here https://www.sololearn.com/post/75089/?ref=app It will help u a lot for next posts and after done once it is easy.
1st Feb 2020, 7:49 AM
Oma Falk
Oma Falk - avatar
+ 2
https://code.sololearn.com/c24cSmlpnQui/?ref=app p.s. look at my comments in your code (#)
1st Feb 2020, 5:35 PM
Valerii Mamontov
Valerii Mamontov - avatar
+ 1
Hi, u defined a function batscore that takes a dictionary abn returns it... a bit modified. for output now call the function and print the dictionary print(batscore(aDict)) where aDict is a dictionary.
1st Feb 2020, 7:34 AM
Oma Falk
Oma Falk - avatar
+ 1
Utsav Singh you are welcome I saw your cricket code.
1st Feb 2020, 7:58 AM
Oma Falk
Oma Falk - avatar
+ 1
My freind, use online-visualization: http://pythontutor.com/visualize.html#mode=edit
1st Feb 2020, 5:37 PM
Valerii Mamontov
Valerii Mamontov - avatar
0
Utsav Singh !!! dont make me sick!! hurry up yourself linking your code!!! 😅😅😅
1st Feb 2020, 7:37 AM
Oma Falk
Oma Falk - avatar
0
Please assuming I what to write a code in Java that will off a mobile phone how can I write that code please I need help
2nd Feb 2020, 7:05 AM
SACKITEY ELIJAH DAVID
SACKITEY ELIJAH DAVID - avatar