"and" is not an operator in Julia, try "&&".

> On Jul 21, 2015, at 11:25 AM, Elsha Robin <elisha....@gmail.com> wrote:
> 
> 
> well i thought i should give julia a whirl since it got so much chatter 
> around it , so i thought i could start of slow and simple and i run into a 
> tree sort of ... so the problem is that i compared the results of two 
> functions in an if statement with an and operator but it spiting some very 
> basic error which i cant figure out what to do with ... so here is the code 
> in question ..
> 
> ________________________________________
> a(i)=20*i - i^2
> b(j)=50 *j - j^2
> c(k)=40 *k - k^2
> for i in 20:50
>     for j in i:50
>         if a(20)==b(50) and c(j)==a(k)
>             print ("got it")
>             break
>         end
>     end
> end
> __________________________________________
> 
> the error spit out is this ...
> syntax: extra token "c" after end of expression
> while loading In[11], in expression starting on line 6
> 
> i can figure that the roblem has to do something with comparing the outputs 
> of functions using looping variables variable { c(j)==a(k) } ... but i dont 
> understand why that should be a problem ... so either ways can some one give 
> me the correct syntax or direct me to a specific DOC with 
> the similar example ... thanks in advance .

Reply via email to