Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

moronic n00b needs help with python

Name: Anonymous 2009-03-09 1:07

I'm a trying to learn Python, I've lurked this board for a while so I already know the general hatred of python that goes on around here. But as far as I can tell it's the easiest for a first language, and too me it looks alot cleaner then Java or Perl. Also since, college is not exactly an option for me at this current time, I'm stuck teaching myself through online tutorials and shitty ebooks. But I ran into a snare in an early tutorial dealing with lists/tuples.

hd_list = []
hd_list[0] = float(input("Capacity of first HD in gigs: "))
hd_list[1] = float(input("Price of first HD in USD: $"))
hd_list[2] = float(input("Capacity of second HD in gigs: "))
hd_list[3] = float(input("Price of second HD in USD: $"))

I know its a fuck simple problem, but I can't figure it out.

nb4 read SICP
(also, my first post here, so I don't know the code tag, sorry)

Name: OP 2009-03-09 4:58

>>8
Thanks that fixed everything. I didn't know I could make the inputs part of the list like that, and trying it never occured to me. Also, the reason I was using "input" over "raw_input" was because the way all the tutorials make it seem is that "input" is designated for integers and/or numbers in general, and that "raw_input" is reserved for only strings involving alphabetical characters. Now I know I was very wrong in that assumption, thank you so much for taking the time to help me.
>>5
I do appreciate that effort you put in there, how ever that does look to me like Javascript, though my knowledge of code is severely lacking and I am most likely very wrong. However I am next to certain that it is not Python, which is most definitely what I stated (multiple times in fact) that I was working with.
So maybe next time, read before you post, it might not mark you off as a troll in everyone's books. ALSO: see the signature on >>6

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List