Reference no: EM133337583
Question 1. Write a function that takes two strings as input and prints them together on one 50-character line, with the first-string left-justified, the second string right-justified, and as many periods between the input strings as needed. For example:
>>>print_left_right( 'hello', 'world')
hello... world
Question 2. Write a function that takes two character strings as input and return true if and only if string1 is longer than the string2 and false otherwise.
Question 3. Write a function that prints true if string2 occurs in string1 and false otherwise.
Question 4. Write a function isAscending(num) that takes an integer as parameter and returns True if all the digits of the number are in ascending order and False otherwise.
Note: You are not supposed to convert the integer to a string. 3 marks will be deducted if you convert the integer to string to get the solution.
Question 5. Write a function firstLastMid that takes a string as parameter and then returns the first character, the last character, and the character in the middle. For example, if the input is Harry, the program prints, H y r. If the word has even length, print the character right before the middle. Assume that the string has length greater than 3. Write the complete docstring.
Question 6. Write a function that counts the occurrence of vowels in any string. (Not Allowed to use built-in functions of strings)
>>>Vowel_occur("Ahsan Mughal"): a : 3
e : 0
i : 0
o : 0
u : 1
Total Occurence : 4