Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I Need Help with Python
#19
(02-05-2010, 10:30 PM)Аноним Интерфейс Wrote: This is how I would have coded it.
Code:
#setting input variables
x=raw_input('Is the water salted?<yes/no>\n>>> ')
y=raw_input('What is the temperature?\n>>> ')

#processing variables
if (x is 'no' and y >= 0):
    print('>>> the water will freeze')
elif (x is 'yes' and y > 10):
    print('>>> the water will freeze')
else:
    print('>>> the water will not freeze')

Eh, either one of our codes work, I personally don't care for the ">>>"'s and the parentheses and comments aren't really necessary but whatever floats your boat I guess.

(02-05-2010, 09:04 PM)Kharnage Wrote: I live in New York and it's for highschool credits.
Me too! you live in the city or what? I really don't want to say where I live on the Internet but it's in one of the 5 boroughs Smile
[Image: izsyo6.jpg]


Reply


Messages In This Thread
I Need Help with Python - by Kharnage - 02-04-2010, 04:01 PM
RE: I Need Help with Python - by uber1337 - 02-04-2010, 06:09 PM
RE: I Need Help with Python - by Gaijin - 02-04-2010, 06:13 PM
RE: I Need Help with Python - by Kharnage - 02-04-2010, 06:35 PM
RE: I Need Help with Python - by Gaijin - 02-04-2010, 06:51 PM
RE: I Need Help with Python - by uber1337 - 02-04-2010, 06:55 PM
RE: I Need Help with Python - by Kharnage - 02-04-2010, 06:53 PM
RE: I Need Help with Python - by Gaijin - 02-04-2010, 06:56 PM
RE: I Need Help with Python - by uber1337 - 02-04-2010, 07:01 PM
RE: I Need Help with Python - by Kharnage - 02-04-2010, 07:16 PM
RE: I Need Help with Python - by Kharnage - 02-05-2010, 02:14 PM
RE: I Need Help with Python - by uber1337 - 02-05-2010, 04:46 PM
RE: I Need Help with Python - by Kharnage - 02-05-2010, 04:51 PM
RE: I Need Help with Python - by uber1337 - 02-05-2010, 08:53 PM
RE: I Need Help with Python - by Kharnage - 02-05-2010, 08:56 PM
RE: I Need Help with Python - by uber1337 - 02-05-2010, 08:59 PM
RE: I Need Help with Python - by Kharnage - 02-05-2010, 09:04 PM
RE: I Need Help with Python - by Canoris - 02-05-2010, 10:30 PM
RE: I Need Help with Python - by uber1337 - 02-05-2010, 10:41 PM
RE: I Need Help with Python - by Kharnage - 02-06-2010, 08:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Help Dεlluzion 3 2,003 09-30-2019, 12:59 AM
Last Post: samsmith001
  Simple Python Python Compiler Canoris 21 9,173 06-01-2011, 06:30 PM
Last Post: Filefinder
  Python 2 vs 3? Jake 8 2,661 12-11-2010, 04:13 PM
Last Post: Bursihido
  Python help Kharnage 2 888 02-12-2010, 09:07 PM
Last Post: Kharnage
  "==" and "is" in Python Canoris 1 846 02-07-2010, 03:55 PM
Last Post: uber1337

Forum Jump:


Users browsing this thread: 1 Guest(s)