Closed jocelyn-cuthbert closed 7 years ago
Nevermind I took out the Break and it worked....
Glad it worked! You're doing very well - keep going!!!
Remember that sometimes an error a few lines earlier can mess up R, so check a few lines ahead of whatever R complains about. You did that in this case, so well done!
So I created a function and put in the extra bracket so that the argument (num in 1:20) would apply to all of the options, and not just the divisable by zero. I can get the function to work for a single number, but when I run the whole code, divisible by 5, prime, and break, I get:
Error: unexpected 'else' in: " is_prime3(num)
} else"