Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have a 2-part question for my Python Programming Assignment I have due. I have to make two palindrome generating functions. Also for the second

I have a 2-part question for my Python Programming Assignment I have due. I have to make two palindrome generating functions. Also for the second function, you can reference the first function in the code to make it easier, my professor said. Thank you!

## RECURSION IS MANDATORY FOR BOTH FUNCTIONS , AND THERE SHOULD BE NO HIGHER-ORDER FUNCTIONS, MEANING THERE SHOULD ONLY BE 2 FUNCTIONS IN ALL OF MY CODE##

image text in transcribed

Write code in Python 3.6 1 ## Question 3.1 ## def create_palindrome_v1(start, end): Creates a palindrome of integers starting from start, ending at end (in the middle) All inputs are positive integers. No input validation required. Parameters: start, end (int), positive integers Returns: palindrome sequence (str) Restrictions. You should use recursion in this question. >>> create_palindrome_v1(1, 1) '1 >>> create_palindrome_v1(3, 5) '34543 >>> create_palindrome_v1(5, 2) 5432345' +++++++++++++++++++++++++ WRITE YOUR DOCTESTS BELOW +++++++++++++++++++++++++ # YOUR CODE STARTS HERE # 24 ## Question 3.2 ## def create_palindrome_v2 (start1, endi, start2, end2): Creates a two level palindrome of integers. The first level (outer les starts from start1 and ends at end1. The second level (inner level) si from start2 and end2. No input validation is required. Parameters: starti, endi, start2, end2 (int), positive integers Returns: palindrome sequence (str) Restrictions. You should use recursion in this question. >>> create_palindrome_v2(1, 1, 1, 1) '1_1_1 >>> create_palindrome_v2(2, 5, 5, 4) 2345_545_5432 >>> create_palindrome_v2(3, 1, 5, 9) 321_567898765_123 +++++++++++++++++++++++++ WRITE YOUR DOCTESTS BELOW ++ +++ ++++++ ++++ + ++++++++ + # YOUR CODE STARTS HERE #

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

Why did his psychologist, Dr. Willard, recommend a psychiatrist?

Answered: 1 week ago