Question: COURSEWORK TASK Write, test and debug a function called isPrime that takes a positive 2 0 marks whole number, n , as its single parameter
COURSEWORK TASK
Write, test and debug a function called isPrime that takes a positive marks whole number, as its single parameter and returns True if is a prime number and returns False if it is not.
A prime number is a whole number that is divisible by no numbers other than and itself Note that is not a prime number. Try implementing this with a while loop and with a for loop.
Write, test and debug a function without parameters called longestOAll which collects a series of strings from a user and prints out the string that is the longest. If two or more strings are of the longest length the function should print the one that the user typed in first.
Write a function findAll that asks the user to type in a character string and a letter to search for, then searches for all instances of the letter specified by the user, and prints the indexes of the positions in which it is to be found and how many times the letter appears in the string
Write a function isvalidPassword that takes a string, pwd as its marks single parameter and checks pwd to determine whether or not it is a marks valid password. The function should return True if is a valid password and False if it is not.
A valid password has the following features
At least lowercase letter from the range az and uppercase letter from the range
At least digit from the range
At least character from the set $#@
No other characters
Minimum length characters.
Maximum length characters.
Compile all your codes in separate files and submit the source code files in BlackBoard along with the report.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
