Question: Python 3 please Exercise 5. Longest Substring Write a program that reads a string and checks the longest substring starting with a and ending with

Python 3 please
Exercise 5. Longest Substring Write a program that reads a string and checks the longest substring starting with "a" and ending with "z" included in it. For example: If s = "bcd bbccdd badefgze tabdz", the longest substring is: 6 Exercise 6. Palindrome Assume s is a string of lowercase characters. Write a program to check if s is a palindrome or not. A string is said to be a palindrome if the reverse of the string is the same as the string itself. For example, "civic", "radar" are palindromes, but "mood" is not a palindrome. The string can be taken as normal input or command line argument. Solve this problem in two different ways: once using a loop structure and once without using any repetition structure. Exercise 7. Turtle Drawing - Polygon In this program, we will use the Turtle module to draw an n-sided polygon. A drawing turtle can move forward and backward by a specified number of pixels and can turn counterclockwise and clockwise by a specified number of degrees. Write a program polygon.py that takes two command line arguments, number of sides and length of each side, and draws a regular n-sided polygon. For example, a hexagon is produced by the following program invocation: > python polygon.py 6 100 Exercise 8. Triangle - Special Diagonal Write a program that takes an integer n from the user, and draws a triangle of n lines as shown below (for n = 5): X x Exercise 9. Strings Combination Having the following two strings, "abcde" and "12345", write the needed code to display the output as shown below: al a2 a3 a4 a5 b1 b2 b3 b4 b5 cl c2 c3 c4 c5 di d2 d3 d4 d5 el e2 e 3 e4 e5 Exercise 10. Number Encryption Write a program that encrypts a four-digit number as follows: for each digit, it adds 7 to it, and get the remainder after dividing by 10, and replaces it by the result. For example: 2560 will be encrypted as 9237
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
