- 1
write a function to accept a tuple and return the sum of elements ending with 3
6 Answers
+ 3
Hi! For better help to you, please, show us your code attempt! Thx!
+ 1
If you want to run & share a code on Sololearn...
Then,
ā”ļø Go to the Code Playground section (you can find it here : https://code.sololearn.com) and click on the + icon at the bottom right corner.
ā”ļø Then select language and write your code and save it.
ā”ļø Then click on Run and your Code will get executed.
Then copy link code, and share it there
OR just copy/paste this (your code solution from task)
+ 1
How will you understand if a value is ended with 3?
Well, if the reminder of the value of 10 is equal to 3 then the value is ended with 3.You can write like this:
if l[i] %10== 3:
Then it says you have to return the value.So you should return s in your code.
So after editing your code it will be like this:
https://code.sololearn.com/ca12A4a14A3A
Note: For testing I have used this tuple (34,56,78,23,45,63)
+ 1
Thank youThe future is now thanks to science . iam weak in python.
0
ŠÆŃŠ¾ŃŠ»Š°Š² ŠŠµŃŠ½ŠøŠ³Š¾ŃŠ°(Yaroslav Vernigora) I don't know how to share in this app