Author Topic: Programming Megathread  (Read 105488 times)

uh ok.
he's suggesting that you should use bash instead of windows command prompt
forget off i mispelled

forget off i mispelled
what? you misspelled what?

I was going to say "subdawoofer likes to pretend he knows what he's talking about", until I changed my mind (not because I decided you might know what you're talking about, fyi)
but the fact that you think you misspelled something makes it kind of clear so I guess I might as well say it


okay now you've edited your post and I know what you supposedly misspelled. you still don't know what you're talking about though, and for precisely the same reason that I was going to say it before
also if you were not, in fact, suggesting he use bash instead, what are you trying to say? he should not use a command line at all? that implies even less knowledge of what you're talking about than I had previously thought
« Last Edit: December 03, 2016, 04:41:06 PM by Foxscotch »

>batch
>>>>>>>>>>>>>>>>>>>>>>>>>>>>batch
careful there you wouldn't want to damage your Model M :^)

careful there you wouldn't want to damage your Model M :^)
>implying a model m works on a chromebook


careful there you wouldn't want to damage your Model M :^)
woah did you just diss model m's
i'll have you know buckling springs are clearly superior to mechanical switches and membrane switches

woah did you just diss model m's
i'll have you know buckling springs are clearly superior to mechanical switches and membrane switches
this

woah did you just diss model m's
i'll have you know buckling springs are clearly superior to mechanical switches and membrane switches
no? Subdawoofer likes to show off his epeen by claiming to own one lol

no? Subdawoofer likes to show off his epeen by claiming to own one lol
ok mom


protip: if you're ever planning to integrate javascript into a game don't use the v8 javascript engine

protip: if you're ever planning to integrate javascript into a game don't use the v8 javascript engine
why

so im having some trouble with this basic program in python: the idea is that it will ask a user to enter in numbers, it will put those numbers in a list, and then it will use a loop to add up those numbers. what am i doing wrong here?

Code: [Select]
def main():
    keep_numbering = 'y'
    numbers = []
    while keep_numbering == 'y':
        num = input("What was the sale for this day?: ")
        numbers.append(num)
        keep_numbering = input("Do you want to add another sale? (y/n): ")

    for index.num in range(len(numbers)):
            total = sum(numbers)

main()

Disclaimer: I never learned python.

In your for loop at the end it looks like you're just reassigning the total variable for each iteration of the loop, which would not accomplish adding each value since the only result you'll get is from the last iteration of the loop.

Disclaimer: I never learned python.

In your for loop at the end it looks like you're just reassigning the total variable for each iteration of the loop, which would not accomplish adding each value since the only result you'll get is from the last iteration of the loop.
the issue seems to be with "index.num" tho, this is the error message i get:
Code: [Select]
Traceback (most recent call last):
  File "C:/Users/xx/Downloads/exam_prepare.py", line 33, in <module>
    main()
  File "C:/Users/xx/Downloads/exam_prepare.py", line 30, in main
    for index.num in range(len(numbers)):
NameError: name 'index' is not defined