18 AnswersNew Answer
18 AnswersNew Answer
I think this is the best way I can make it https://code.sololearn.com/cKUrJu0eYkTr/?ref=app
Mafdi, that's the solution of my problem, I was think in that, thank you. By the way, thanks to all(꧁Ankit, Kode Krasher and Elon Yemp #RELOADED#
★«Caleb Guerra Ortega»★ Your anwer https://code.sololearn.com/cFTQ57KsQqf2/?ref=app
꧁Ankit Chatterjee[LESS ACTIVE THAN EVER]꧂ I want to print the number of the for loop is the sum of all numbers is 14.
Because you are giving a list of strings to the sum function.
꧁Ankit Chatterjee[LESS ACTIVE THAN EVER]꧂ do you think in list comprehension or are you just showing off?! Nice Code BTW! 😎👍
Kode Krasher what will I do by show off get followers 😏! after 1 month I will leave sololearn btw, there's no need of show off
Kode Krasher i just posted his answer, I guessed what he wanted to do. And Thanks for praising my code. 😐
Kode Krasher you are right I am aren't an beginner in python. I just don't complete courses for I come here to code and meet my dear friends, I have Completed python, java , web., lol Happy Coding! 😎👍 I don't like gifts take this return gift 📦 😎👍
꧁Ankit Chatterjee[LESS ACTIVE THAN EVER]꧂ I sorry, but I can't modify the range of the code.
What do you want to do in the code??
Mafdi is Right. You are giving a list of chars and not a list of digits. Convert the chars in digits Do sum([int(d) for d in list(str(number))])
Jamil Waheeb Hello
★«Caleb Guerra Ortega»★ Do you understand the error? ask yourself a few of questions: 1. what data type is your variable "number" 2. why would you cast it to a string to do a calculation? 3. where is your list? I don't have time to dig any further. But I think those items are obvious enough that it might help you rewrite your code so it works? Happy Coding! 😎👍
★«Caleb Guerra Ortega»★ I might look at this in the morning (no promises)... just for clarity: You want to know the number that your for loop generates that when split sums to 14? example: 100706 = [1,0,0,7,0,6] = 14 Sounds like a fun problem for python?! post your solution if you find it before I get to it. 😉 Happy Coding! 😎👍
꧁Ankit Chatterjee[LESS ACTIVE THAN EVER]꧂ something told me you weren't a beginner at python? lol Happy Coding! 😎👍
★«Caleb Guerra Ortega»★ Welcome!
Sololearn Inc.4 Embarcadero Center, Suite 1455
Send us a message