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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started