Question: 4.1. [Python] Write a Python function is prime() to check whether an input value is a prime. That is, if the input p is

4.1. [Python] Write a Python function is prime() to check whether an 

4.1. [Python] Write a Python function is prime() to check whether an input value is a prime. That is, if the input p is a prime number, then the function outputs 1. Otherwise, outputs 0. (@4%) 4.2. [Python] Please complete the following function, it factorizes the input n: (@6%) def factorization (n): if return n else: for j in range (2, int (math.sqrt(n)) +1, 1): if n % j 0: return Example 1: print (factorization (10)) The output is: 2 5 Example 2: print (factorization (66)) The output is: 2 3 11 Example 3: print (factorization (103)) The output is: 103

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!