Change Array Index Python Function For Prime