Question: 1. write a function factor in python that takes one parameter a number and return the first interger >= 2 that evenly devides the number.
1. write a function factor in python that takes one parameter a number and return the first interger >= 2 that evenly devides the number. if there is none then return the value of argument.
factor(3) returns 3
factor(11) returns 11
factor(33) returns 3
2. Write a function in python isStringSorted(string) and returns true if the letters are in ascending order.
isStringSorted(" ") returns true
isStringSorted("a") returns true
isStringSorted("cda") returns false
isStringSorted("Aa") returns true
isStringSorted("abbcddef") returns true
3. Write a function allALeft which takes a string and return the same string with upper case A in the left.
allALeft(" ") returns " "
allALeft("A") returns A
allALeft("BA") returns AB
allALeft("AbcdaaaefAgiAA") returns AAAAcdaaaefgi
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
