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]
3 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]3 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
to protect a windows 10 system, you've configured system restore to automatically protect your system using restore points. will
zheka24 [161]

This can't adequately protect the user data on the system as one needs to enable file history.

<h3>How to depict the information?</h3>

In order to protect a windows 10 system, one will need to configure the system restore to automatically protect your system using restore points.

Despite this, this can't adequately protect the user data on the system as one needs to enable file history.

Learn more about windows on:

brainly.com/question/25243683

#SPJ12

8 0
1 year ago
I need the answer to life. I cant live without my POGCHAMPS!
Ilya [14]

Answer:

Pray to God and ask him for help in life. May God bless you

Explanation:

8 0
3 years ago
Read 2 more answers
What time is spellrd the same forwards and backwards​
Juliette [100K]
12:21 is the correct answer
6 0
2 years ago
The largest value (in hex) that can be loaded into Register A of HCS12 is (Points : 2) 0x8.
andrezito [222]

Answer:

0xFF.

Explanation:

The Register A of HSC12 is an 8-bit register.So the maximum value for 8 bit is 8 1's (11111111). So the decimal value for the maximum 8 bits is 255 but all the options given are in hexadecimal so among the given options only 0xFF has the value of 255 in decimal  F=(1111)₂.So two F's make 8 bits and their decimal value is 255.

7 0
3 years ago
Someone plzzzz help me
IgorC [24]

Answer:

Data base

Explanation:

Database holds all your information.

8 0
3 years ago
Other questions:
  • Which connector is most commonly used to connect printers to desktop pc systems?
    10·1 answer
  • When you begin typing text, the _________________________ appears on the status bar with an animated pencil writing on paper tha
    15·1 answer
  • ____ deals with ensuring that data is protected against unauthorized access, and if the data are accessed by an authorized user,
    10·1 answer
  • You listened to a song on your computer. Did you use hardware or software? Explain.
    11·2 answers
  • What is the program that searches through data bases?
    10·1 answer
  • Susan has always wanted to be a veterinarian. When doing her research, she answers all self-assessments geared toward that caree
    13·1 answer
  • Which of the following are tasks you can
    12·2 answers
  • Which of the following is the correct ordering of operating systems, oldest to newest?
    5·2 answers
  • A computer essentially takes input, processes it, and produces output. Which person developed a machine in the mid-1880s that ac
    6·1 answer
  • Users at UC need to be able to quickly create a Resource record from the Project record's Chatter feed How should the App Builde
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!