Alogrithm 1:
Get a list of numbers L1, L2, L3....LN as argument
Assume L1 is the largest, Largest = L1
Take next number Li from the list and do the following
If Largest is less than Li
Largest = Li
If Li is last number from the list then
return Largest and come out
Else repeat same process starting from step 3
Algorithm 2:
Create a function prime_number that does the following
Takes as parameter an integer and
Returns boolean value true if the value is prime or
Returns boolean value false if the value is not prime
So far my code is :
def get_algorithm_result(num_list): largest =num_list[0] for item in range(0,len(num_list)): if largest < num_list[item]: largest = num_list[item] return largestdef prime_number(integer): if integer%2==0:return Falseelse:return True
After executing the code i get
"Test Spec FailedYour solution failed to pass all the tests"
where am I going wrong?