
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
Concept explainers
Question
21.2 LAB: Remove spaces - functions
Write a program that removes all spaces from the given input.
Ex: If the input is:
Hello my name is John.the output is:
HellomynameisJohn.
Your program must define and call the following function. The function should return a string representing the input string without spaces.
remove_spaces (user_string)
Use Python, please.

Transcribed Image Text:LAB
21.2.1: LAB: Remove spaces - functions
0/10
АCTIVITY
main.py
Load default template..
1 def remove_spaces (user_string):
2
# Type your code here.
3
4
5 if
name
== ' main':
# Type your code here.
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 2 steps with 1 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Please explain Python code # 2) write a procedure that takes a string and # returns it with all its vowels deleted# e.g. Wilkes! would return Wlks!# assume vowels are: aeiou sometimes ydef killvowels(word):vwlss = ""for c in word:# if it is not a vowelif c not in ['a','e','i','o','u']:if c != 'y' or (c == 'y' and random.choice([1,2,3,4]) != 1):vwlss += creturn vwlssdef killvowelsinplace(word):for c in range(len(word)):if word[c] in ['a','e','i','o','u']: # let's ignore yword = word[:c] + word[c+1:] return worddef vowelkiller(word,index):if index < len(word):if word[index] in ['a','e','i','o','u']: # let's ignore yword = word[:index] + word[index+1:] index =- 1 # lost a vowel, so reset indexreturn vowelkiller(word,index+1)return worddef rkillvowelsinplace(word):return vowelkiller(word,0)#rspitoutchars("Wilkes!")print(rkillvowelsinplace("Wilkes!"))print(rkillvowelsinplace("awesome"))print(rkillvowelsinplace("great!"))arrow_forwardC++ PLEASE!! // FILE: simplestring.h// CLASS PROVIDED: string (a sequence of characters)//// CONSTRUCTOR for the string class:// string(const char str[ ] = "") -- default argument is the empty string.// Precondition: str is an ordinary null-terminated string.// Postcondition: The string contains the sequence of chars from str.//// CONSTANT MEMBER FUNCTIONS for the string class:// size_t length( ) const// Postcondition: The return value is the number of characters in the// string.//// char operator [ ](size_t position) const// Precondition: position < length( ).// Postcondition: The value returned is the character at the specified// position of the string. A string's positions start from 0 at the start// of the sequence and go up to length( )-1 at the right end.//// MODIFICATION MEMBER FUNCTIONS for the string class:// void operator +=(const string& addend)// Postcondition: addend has been catenated to the end of the string.//// void operator +=(const char addend[ ])//…arrow_forwardprogram3_4.pyWrite a creative quiz program with three original questions that you make up as specified below. Immediately after each question is answered, the program should respond positively to right answers or provide the correct answer if the user's answer is wrong. The quiz doesn't have to be scored. One question should require an answer of type int. One question should require an answer of type float. One should require a string answer.arrow_forward
- 1. string color = "Yellow"; //What does this code do? a. declares a structure b. calls a function c. creates a character array d. creates an object 2. The strcmp function returns ____________________. a. 0 if the two strings are equal b. a negative value if the first argument is alphabetically less than the second c. a positive value if the first argument is alphabetically greater than the second d. all of a through c are truearrow_forwardNeed help with example 10 please and thank youarrow_forwardComplete the function ConvertToWeeksAndDays to convert totalDays to weeks and days. Return weeks and days using the TimeWeekDay struct. Ex: 26 days is 3 weeks and 5 days. Only lines 11-13 can be added onto, the rest of the program can't be changed.arrow_forward
arrow_back_ios
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