1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
poizon [28]
3 years ago
5

one_diff(a?): Description: Determine if there is exactly one character different between exactly two strings. Parameters: Determ

ine these from the description, and the provided examples. Return value: True If there is exactly one character different, False otherwise Example: one_diff("banana", "apple") → False one_diff("need", "reed") → True one_diff("goof", "good") → True one_diff("food", "feed") → False

Computers and Technology
1 answer:
Vladimir79 [104]3 years ago
3 0

Answer:

See explaination

Explanation:

def one_diff(s1,s2):#mthod return true if s1 and s2 has one difference

l1=list(s1)#store characters to list

l2=list(s2)

c=0

if len(l1)!=len(l2):

return False

for i in l1:

if i in l2:#for each character if it is in l1 and l2 continue

continue

else:

c+=1

if c==1:

return True#ret True if cis 1 else False

return False

def exchange(s,*k):#method that exchanges characters

l=list(k)

if len(l)!=0:#check validity of arguments

for i in l:

if i<0 and i+(2*i)>len(s):

res=s

elif i>len(s):

res=s

return res

if len(l)==0:#if no indexes are given

c1=s[0]

c2=s[-1]

res=c2

res=res+s[1:]

res=res[0]+res[1:].replace(c2,c1)

return (res)

elif len(l)==1:#if one index is given

c1=s[l[0]]

c2=s[-1]

res=''

for i in s:

if i==c1 or i==c2:

if i==c2:

res+=c1

else:

res+=c2

else:

res+=i

return (res)

else:#if two indexes are given

c1=s[l[0]]

c2=s[l[1]]

res=''

for i in s:

if i==c1 or i==c2:

if i==c2:

res+=c1

else:

res+=c2

else:

res+=i

return (res)

def is_chain(*k):#method that checks words for one difference

l=list(k)

if len(l)==0:

return False

if len(l)==1:

return True

if len(l)>1:

for i in range(len(l)-1):#for two words in l

if one_diff(l[i],l[i+1]):#call one_diff method

continue

else:

return False

return True

def scramble(s):#method that exchanges characters

i=0

while i<len(s)-1:

s=exchange(s,i,i+1)

i+=2

print(s)

please check out the screenshots in attachment.

You might be interested in
Sherri is considering replacing a processor on her laptop. The laptop is running slower than she would like. What should Sherri
Schach [20]

Answer:

Option b, Option c, and Option d  are the correct options.

Explanation:

While Sherri is replacing the laptops processor because her's laptop working slow as compared to the past performance then, she decided to ensure to use the right processors for her laptop's motherboard. Then, she verifies that not under the warranty, and she also determines that the teardown procedure is available or not.

4 0
4 years ago
What is Groovefunnels?
Andreyy89

GrooveFunnels is a game-changer and it’s disrupting the market quite a bit.
5 0
3 years ago
Read 2 more answers
In the NumPy function, the data preparation technique that is used to help machine learning algorithms is called _________.
KonstantinChe [14]

In the NumPy function, the data preparation technique that is used to help machine learning algorithms is called the reshape technique or function

For better understanding, let us explain what the reshape function means

  • The numpy package helps to give the right tools for scientific and mathematical computations in python . it includes functions that cam be used to perform common linear algebra operations, fast Fourier transforms, and statistics The reshape function simply alter or change the row and column arrangement of data in numpy function and it is said to just give new shape to an array without the altering of its data.

from the above, we can therefore say that the answer In the NumPy function, the data preparation technique that is used to help machine learning algorithms is called the reshape technique or function is correct

learn more about reshape function  from:

brainly.com/question/24728884

3 0
2 years ago
You can sort data in a table or_____?<br><br><br> A. Report<br> B. Form<br> C. Field<br> D. Record
Mazyrski [523]

Answer:I believe its form

Explanation:

7 0
3 years ago
Read 2 more answers
Write a paper of at least 300 words that includes:
Marina86 [1]

Answer:Let’s start with a review of the essential steps in the career planning process.

Career Planning

Shepard and Mani define career planning “as an ongoing process through which an individual sets career goals and identifies the means to achieve them” (2013, p. 14). It is through career planning that a person evaluates abilities and interests, assesses values and personality, considers alternative career opportunities, establishes career goals, and plans practical developmental activities.

Career planning requires individuals to understand themselves and their values, interests, and skills. It is also an ongoing process, one that must be repeated with changes in employment and life circumstances. As you gain more experience and knowledge, the process will begin anew.

This section reviews the five essential steps of career planning, which are based on our research and input from industry experts:

Conduct a self-assessment

Research the labour market

Create your career search toolkit

Put your career campaign into action

Engage in networking

Let’s start at step one.

Step One: Conduct a Self-Assessment

Self knowledge is the key to choosing a career. It can be overwhelming to begin the process of self-assessment. However, if done well at the start, the likelihood of securing work that has meaning, purpose, and fulfillment is far greater. Understanding your preferences, knowing your strengths, and honestly facing the areas you need to develop are the first steps for effective self-assessment.

Explanation:

7 0
3 years ago
Other questions:
  • Effective note-taking helps support<br><br> action.<br> distinction.<br> distraction.<br> retention.
    9·2 answers
  • A car holds 16 gallons of gasoline and can travel 312 miles before refueling. Write aC++ program that calculates the number of m
    9·1 answer
  • If you implement a Wireless LAN (WLAN) to support connectivity for laptops in the Workstation Domain, which domain does WLAN fal
    5·1 answer
  • A style manual can be described as
    11·2 answers
  • The blank provides access to the internet May also be internal ??
    14·1 answer
  • Write a program in python to test if given number is prime or not.
    6·2 answers
  • Why is data processing done in computer?​
    14·1 answer
  • What is the function for displaying differences between two or more scenarios side by side?
    11·2 answers
  • Edhesive 3.4 practice 1
    9·1 answer
  • On the MarketingConsultants worksheet, in cells D10:H13, use a PMT function to calculate the end of the month payment amount. En
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!