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

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 Databases Questions!