Reputation: 34 Craftsman
- Active Members
- Active Posts:
- 262 (0.44 per day)
- 11-May 13
- Profile Views:
- Last Active:
- Dec 16 2014 06:42 PM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Who Cares
- Dream Kudos:
Posts I've Made
Posted 26 Oct 2014Try chrome.exe at the end of Line 2.
Also should be backslashes (\), not forward slashes (/).
Posted 24 Oct 2014Typo on Line 3. Change 'fro' to 'for'
Posted 24 Oct 2014
for i in answers: if i > maximum: maximum = i i += 1 else: i += 1 print(maximum)
JFYI you shouldn't be changing the value of i (the sentinel) with this loop, and there is no need to change it anyway. You can just do:
for i in answers: if i > maximum: maximum = i
Yeah, I've been working a lot with other languges recently, and totally forgot how awesome Python loops are. Thanks for the reminder.
Posted 23 Oct 2014For future reference put you code in [code] tags. Ok, so you have some code good. What from your original goal are you missing? What exactly are you having trouble with?
Posted 23 Oct 2014Glad I could help! />
Just for the record, I was going for something like this.
women = [158, 166, 150, 158, 152, 160, 172, 159, 158, 162] men = [168, 172, 181, 166, 172, 174, 165, 169, 169, 185] answers =  maximum = 0 for w_height, m_height in zip(women, men): difference = w_height - m_height a_difference = abs(difference) answers.append(a_difference) print(w_height, m_height, a_difference) for i in answers: if i > maximum: maximum = i i += 1 else: i += 1 print(maximum)
- Member Title:
- D.I.C Regular
- 15 years old
- April 6, 1999
- Austin, Texas, USA
- World Languages, Programming, Web Development, Soccer, Math!
- Full Name:
- Years Programming:
- Programming Languages:
VB.NET, C, XML, XSL, Schema, XML DOM, Scratch
- Click here to e-mail me