so i am having to do this:
Write the code to multiply the numbers 1 through 7.
The output should look like: 1x2x3x4x5x6x7 = 5040
remember you can use end in print to print items on the same line
You will need to use a for loop with range
You will need to create a variable called total and initialize it to 1 not 0
Use range to print the first half of spellList
spellList = ["Wednesday", "Tuesday", "February", "November", "Annual", "Calendar", "Solstice"]
You will need to use len() to help find the middle of the list
and i am trying to work with it, but i am not getting the results it says im supposed to get. Any advice or help? @Coder100
it i wasnt stuck then i wouldnt ask for help. Thanks in advance! Yall the best
Use this code:
total = 1 for i in range(1, 8): total = i * total print(total) **That should work**
ok sure, try something like:
output = 1 for i in range(1, 8): output *= i print(i)
for the first problem, and for the second one,
spellList = ["Wendesday", "Tuesday", "February", "November", "Annual", "Calendar", "Solstice"] for i in range(len(spellList) / 2): print(spellList[i])
You are attempting to append to a integer variable.
I think you mean to have
number1.append(num) on line 8.
Also, on line 13, do:
for item in spellList: print(len(item))
Also, do not ping other users unless absolutely needed, especially pinging users just because of there cycles.
Keep it fair and enable everyone to help out, not just one person.
No I don't have a problem with it, it is just annoying that that's all anyone does is ping coder100 and ignore everyone else's answers BUT his.
But that was not what I was asking about. I was asking why you need to use the range keyword lol. I don't see why you would need it.
No I know you don't, but that does not disregard the fact that users will acknowledge other peoples answers, but as soon as coder100 comments he gets picked as the correct answer.
I don't really care about cycles, but for people who care about cycles probably find it very unfair.
Besides, coder100 is on all the time and I am sure he will come across everyone's most recent question without people needing to ping him lol.
Don't get me wrong, my guy coder100 is pretty outstanding and smart, but it is kinda unfair due to the fact people ping him, disregard everyone else's answers and picks his as the correct one although they might have received like 8 other correct answers xD.
I am not bashing you, or coder100 or anyone who pings him..I understand why people do..but to me it just seems a little bit unfair
No not my point lol. Ping him if needed. I really don't care. You're actually fair. But other users ignore literally everyone else's answers but his. Again, I have no problem against it and I seriously don't mean to come off being rude in any sort of way.
Sorry if it seemed as if I was coming off rude
I REALLY don't understand what you were trying to do, or why you need 13 lines to multiply numbers in a loop. The error is that you declared an integer named
total and now you're trying to append items to it as it was a list.