
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
You are not allowed to use any imports. You may not use any lists or list methods. Do not use try-except statements. I included the is-palindrome function down below
![Edef is palindrome (string: str) -> bool:
Your "is_palindrome" implementation from last week (Lab 3), which you may
use as is or with modifications if you didn't get it right last time.
low = string.Lower().replace (" ", "")
%3D
return low == low[::-1]](https://content.bartleby.com/qna-images/question/6fcf3e2f-df51-465f-abf1-a22eda6584a2/6dd97541-fbc8-45e6-bdd8-c2589f14314d/vgnt5_thumbnail.jpeg)
Transcribed Image Text:Edef is palindrome (string: str) -> bool:
Your "is_palindrome" implementation from last week (Lab 3), which you may
use as is or with modifications if you didn't get it right last time.
low = string.Lower().replace (" ", "")
%3D
return low == low[::-1]

Transcribed Image Text:36
edef is palindrome_string(string: str) -> bool:
37
38
Given a string <string>, return whether this string is a palindrome string.
39
40
For the purposes of this function, a palindrome string is any string that
forms a palindrome if you piece together the first letter of every word in
the string. We define a word here to be ANY CONTINUOUS SEGMENT OF
41
42
43
ALPHABETICAL CHARACTERS. That means that "abc;def", has twO words: "abc"
44
and "def". The separating character does not have to be whitespace, and
45
there could be more than one separating character between two words.
46
47
Since you will be using your is_palindrome function from last week, the
48
definition of a palindrome will remain the same as the definition from
49
last week (ignore capitalization and whitespace).
50
51
A simple example: given the string "test string test", there are three
52
words, "test", "string", and "test". The first letters of each word come
53
together to form the string "tst". And since "tst" is a palindrome, this
54
function should return True for the input "test string test".
55
56
Precondition: <string> will contain at least one word.
57
58
Restrictions: you must use your "is_palindrome" function from lab 3 as a
helper for this function, in addition to the lab restrictions
defined at the start of this file. You are allowed and are
encouraged to fix any issues with your previous submission
for this function.
59
60
61
62
63
64
pass
65
台1台|
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 2 images

Knowledge Booster
Similar questions
- -Write a statement that assigns the list of seasons of the year to the variable seasons in the following order in Python: Winter Spring Summer Fall -Write one statement that uses the in operator to test if the element 'surfing' is present in list listActivities and print the results. -Using the del keyword and/or the slicing operator:, delete the 3rd through the 5th element from the list listTemps. You've been provided a list named myLst, of six integers. Set the fourth element's value to 7.arrow_forwardWhen using a for-loop to modify a list, you always have to make a copy of the list. (a) True (b) False Thank you!arrow_forward- Do not add any imports, the ones that you need will be given to you.- Do not use recursion.- Do not use break/continue.- Do not use try-except statements, you should be able to anticipateor prevent any errors from happening at all!arrow_forward
- Select problem below. Your post must include: The problem statement. A description of your solution highlighting the use of the split(), join(), lists and the different list operations involved in solving the problems. Include line numbers from your program dont use JAVA Make Username. Create a program that reads a full name as a single string, and and uses the split creates a username with the following rules: The first character of the username is the first character of the first name. The second character of the username is the first letter of the middle name, if one was provided. The rest of the characters will be a prefix of the last name, long enough to meet the length requirement. The username can have up to 8 characters only, and in lowercase. Here is a sample execution:arrow_forwardIn python don't import librariesarrow_forwardPLEASE DO NOT USE BUILT IN FILES OR FUNCTIONS! Write a program in c++ and make sure it works, that reads a list of students (first names only) from a file. It is possible for the names tobe in unsorted order in the file but they have to be placed in sorted order within the linked list.The program should use a doubly linked list.Each node in the doubly linked list should have the student’s name, a pointer to the next student, and apointer to the previous student. Here is a sample visual. The head points to the beginning of the list. Thetail points to the end of the list.When inserting consider all the following conditions:if(!head){ //no other nodes}else if (strcmp(data, head->name)<0){ //smaller than head}else if (strcmp(data, tail->name)>0){ //larger than tail}else{ //somewhere in the middle} When deleting a student consider all the following conditions:student may be at the head, the tail or in the middleBelow, you will find a sample of what the…arrow_forward
- python help, please show all steps and include comments Write a function largerLst() that takes a list of numbers (i.e., int or float values) as a parameter and returns a new list constructed out of it. The list returned has all the values in the parameter list that are larger than the element immediately to their right, that is, larger than their right neighbor. If the parameter list is empty or there are no values larger than their right neighbor, then the function returns an empty list. Note that the last element in the list will never be included in the list returned since it does not have a right neighbor. The function should not change the parameter list in any way. Note that a correct solution to this problem must use an indexed loop That is, one that makes a call to the range() function to generate indices into the list which are used to solve the problem (Review lecture notes 8-1). A solution that does not use an indexed loop will not be accepted. Note in particular that you…arrow_forwardPython code please help, indentation would be greatly appreciatedarrow_forwardData structure and algorithms. DYNAMIC DATA STRUCTURE LINKED LIST. PURPOSE OF WORK : Consolidation of knowledge on the theoretical foundations of presentation of data in the form of links, classification of lists, learning to solve problems using the LIST standard template library in C++. Task : Write a program to process a linked list from the standard template library. Perform an individual task as a separate function. Implementation of automatic filling and display functions with random data in the program. The task is : The list is given. Create a function to calculate the arithmetic mean value of the elements of the list equal to the Fibonacci number.arrow_forward
- Matich the following statements with the correct data structure by clicking on the drop down arrow and selecting the correct choice.. You need to store a list of elements and the number of elements in the program is fixed. If most of operations on a list involve retrieving an element at a given index. You have to add or delete the elements at the beginning of a list. Linked List ArrayList Arrayarrow_forwardin python pleasearrow_forwardQuestion 15 kk .Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this linearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education