12-16-2018, 06:31 PM
Hello
Please try the following instructions on the hp-prime calculator:
index:=1:; E_ := [ "H", "E", "L", "L", "O" ]:; find( "L", E_ ); index(E_,"L"); [enter]
"Done","Done",[3,4],3 // ok
Now index -> 0
index:=0:; E_ := [ "H", "E", "L", "L", "O" ]:; find( "L", E_ ); index(E_,"L"); [enter]
"Done","Done",2,2
the output should be
"Done","Done",[2,3],2
index:=1:;index("abracadabrant","c") [enter] error // the output should be 5
index:=0:;index("abracadabrant","c") [enter] -1 // the output should be 4
Thanks
Please try the following instructions on the hp-prime calculator:
index:=1:; E_ := [ "H", "E", "L", "L", "O" ]:; find( "L", E_ ); index(E_,"L"); [enter]
"Done","Done",[3,4],3 // ok
Now index -> 0
index:=0:; E_ := [ "H", "E", "L", "L", "O" ]:; find( "L", E_ ); index(E_,"L"); [enter]
"Done","Done",2,2
the output should be
"Done","Done",[2,3],2
index:=1:;index("abracadabrant","c") [enter] error // the output should be 5
index:=0:;index("abracadabrant","c") [enter] -1 // the output should be 4
Thanks