Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3. (10 pts) Write a function called hws_problem3 that returns a string (say, text). This string is the old string type that uses single quotes).
3. (10 pts) Write a function called hws_problem3 that returns a string (say, text). This string is the old string type that uses single quotes). The function should print the first four characters of the string four times. If the string length is less than four, print whatever is there four times. Below are two example executions: > hw5_problem3( CS1183) The front four of CS1103 is CS11CS11CS11CS11 > hw5_problem3'ABC) The front four of ABC is ABCABCABCABC Notes: - Remember that this function prints something and does not return anything. - There should be no additional spaces at the end of the line (e.g., there should be no additional spaces after the text "CS11cs11cs11cs11") - There should be a new line character at the end of the line (notice that the prompt> is in a separate line from the printed text). If you believe the message printed by your function is correct, contact the instructor
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started