Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

Students also viewed these Databases questions

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago