Omnimaga

General Discussion => Technology and Development => Computer Programming => Topic started by: jb3navides on May 28, 2013, 09:31:10 pm

Title: I need help
Post by: jb3navides on May 28, 2013, 09:31:10 pm
    if condition1 == "beef" or "lamb" or "venison", and condition2blv <= 5, and condition3 == "rare":
        print condition2blv * 20

the problem seems to be the comma after "venison"
When I run it in powershell (windows) there is an arrow pointing to the comma I mentioned
condition1, condition2blv, condition3 are all variables from past functions, (involves raw_input())
Title: Re: I need help
Post by: Hooloovoo on May 28, 2013, 10:35:59 pm
What language is this? I may be able to help.
It looks like Python because of the raw_input(). Try deleting the commas. Python only uses commas as separators in arguments.
to fix this, it would be
Code: [Select]
if (condition1=="beef" or condition1=="lamb" or condition1=="venison") and (condition2blv <= 5) and condition3=="rare":
    print condition2blv * 20
Title: Re: I need help
Post by: jb3navides on May 29, 2013, 03:07:49 am
Yes it is python and thanks for the help, I've been spamming my powershell terminal trying to figure it out.
 :banghead: :evillaugh: