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
Vanyuwa [196]
4 years ago
8

Problem 1a. Write a function named hasFinalLetter that takes two parameters 1. strList, a list of non-empty strings 2. letters,

a string of upper and/or lower case letters The function hasFinalLetter should create and return a list of all the strings in strList that end with a letter in letters.
Computers and Technology
1 answer:
mash [69]4 years ago
8 0

Answer:

The answer is the programming in Python language has strings and characters that has to be declared in the method.

Explanation:

#method

def hasFinalLetter(strList,letters):

output = #output list

#for every string in the strList

for string in strList:

#findout the length of each string in strList

length = len(string)

#endLetter is last letter in each string

endLetter = string[length-1]

#for each letter in the letters list

for letter in letters:

#compare with endLetter

#if we found any such string

#add it to output list

if(letter == endLetter):

output.append(string)

#return the output list

return output

#TestCase 1 that will lead to return empty list

strList1 = ["user","expert","login","compile","Execute","stock"]

letters1 = ["a","b","y"]

print hasFinalLetter(strList1,letters1)

#TestCse2

strList2 = ["user","expert","login","compile","Execute","stock"]

letters2 = ["g","t","y"]

print hasFinalLetter(strList2,letters2)

#TestCase3

strList3 = ["user","expert","login","compile","Execute","stock"]

letters3 = ["k","e","n","t"]

print hasFinalLetter(strList3,letters3)

You might be interested in
Suppose you want to write an if statement with multiple alternatives to print out someone's tax bracket based on their income. A
soldier1979 [14.2K]

Answer:

b) The conditions should use an if else/if else sequence, not just independent if statements

hope it answers the question:)

6 0
3 years ago
Which line of code will use the overloaded division operation?
DerKrebs [107]

Answer:

B. result = numA/numB

Explanation:

__truediv__ overloads the / operator in Python. Since that has been defined in the class "num" and numA and numB are both objects of type "num" (numA / numB) will call num.__truediv__ using numA as "self" and numB as "b".

7 0
3 years ago
What is the difference between autofocus and autocomplete
Vladimir [108]

Answer:

https://www.c-sharpcorner.com/interview-question/explain-autofocus-and-autocomplete-attribute

found this on a website hope you find it useful !

8 0
3 years ago
_____ is a valid URL, or internet address. In this URL, ______ indicates the protocol.
Natalija [7]

Answer:

1. B.http://www.example.com

2. A. http

Explanation:

7 0
3 years ago
What is one advantage of NAT?
Jet001 [13]

Answer:

a. The company can lease fewer public IP addresses.

Explanation:

A network is an interconnection or intercommunication of network devices within a specific location. There are different types of networks, they are local area network (LAN), wide area network (WAN) etc.

The LAN is a network in a small area, while WAN covers a very large area or distance.

The LAN uses private IP addresses that are not routable on the internet and subscribing for public IP addresses (which are routable on the internet) on all computers in a network, would be expensive and would cause traffic congestion.

3 0
3 years ago
Read 2 more answers
Other questions:
  • What has prompted schools to add Internet activities in their academic integrity policies?
    6·2 answers
  • The sheets that supply the data in a summary sheet are called the
    10·1 answer
  • What is the difference between deta security and privecy ?
    12·2 answers
  • Consider the following methods:
    10·1 answer
  • Thegroup of technologies concerned with the capturing, processing and transmissionof information in the digital electronic form
    9·1 answer
  • your computer running Windows 10 is doing some very strange things with operating system you are fairly certain it is not a hard
    13·2 answers
  • David has created a lot of styles and now his Quick Style Gallery contains styles he no longer uses.
    10·1 answer
  • Select the TRUE statement from those listed below. (Select 1)(1pts) Question 11 - Select the TRUE statement from those listed be
    14·1 answer
  • Drag each tile to the correct box.
    8·1 answer
  • Which original VPN protocol is supported by most platforms but offers low levels of security?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!