Write a python program that splits a given string on a given split character. The first input is a String and the second input is the character that will be used to split the first String. [You cannot use the built-in split function] Sample Input 1: This-is-CSE110 Sample Output 1: This is CSE110 Explanation: The second input which is the character , is used to split or divide the first input String 'This-is- CSE110' into 'This', 'is' and 'CSE110' which are printed individually in seperate lines.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

please solve those questions by using python with (.py) file

Task 8
Write a python program that splits a given string on a given split character. The first input is a String and the
second input is the character that will be used to split the first String. [You cannot use the built-in split function]
Sample Input 1:
This-is-CSE110
Sample Output 1:
This
is
CSE110
Explanation: The second input which is the character , is used to split or divide the first input String 'This-is-
CSE110' into 'This', 'is' and 'CSE110' which are printed individually in seperate lines.
Sample Input 2: tom@gmail,harry@yahoo,bob@gmail,mary@gmail
Sample Output 2:
tom@gmail
harry@yahoo
bob@gmail
Activate Window
Go to Settings to active
mary@gmail
===
Transcribed Image Text:Task 8 Write a python program that splits a given string on a given split character. The first input is a String and the second input is the character that will be used to split the first String. [You cannot use the built-in split function] Sample Input 1: This-is-CSE110 Sample Output 1: This is CSE110 Explanation: The second input which is the character , is used to split or divide the first input String 'This-is- CSE110' into 'This', 'is' and 'CSE110' which are printed individually in seperate lines. Sample Input 2: tom@gmail,harry@yahoo,bob@gmail,mary@gmail Sample Output 2: tom@gmail harry@yahoo bob@gmail Activate Window Go to Settings to active mary@gmail ===
Task 9
Suppose you are given two strings, s1, and s2. Now, print a new string made up of the last characters and then
the first characters of the input strings.
Sample Input 1:
s1 = new
s2= string
Sample Output 1:
gwsn
Explanation: The last character of the String s2 is 'g'. The last character of the String s1 is 'w'. The first character
of the String s2 is 's'. The first character of the String s1 is 'n'. Together they give us the ouput we want 'gwsn'.
Sample Input 2:
s1 = abcd
s2= efgh
Sample Output 2:
hdea
Explanation: The last characters of the Strings s2 and s1 is 'h' and 'd' respectively while the first characters of indow
the Strings is 'e' and 'a' respectively. Together they give us the ouput we want 'gwsn'.
Go to Settings to activ
Transcribed Image Text:Task 9 Suppose you are given two strings, s1, and s2. Now, print a new string made up of the last characters and then the first characters of the input strings. Sample Input 1: s1 = new s2= string Sample Output 1: gwsn Explanation: The last character of the String s2 is 'g'. The last character of the String s1 is 'w'. The first character of the String s2 is 's'. The first character of the String s1 is 'n'. Together they give us the ouput we want 'gwsn'. Sample Input 2: s1 = abcd s2= efgh Sample Output 2: hdea Explanation: The last characters of the Strings s2 and s1 is 'h' and 'd' respectively while the first characters of indow the Strings is 'e' and 'a' respectively. Together they give us the ouput we want 'gwsn'. Go to Settings to activ
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY