Please follow the instructions line by line, make sure you get the correct logic if you don't know the python program or
Posted: Fri Jul 01, 2022 5:51 am
Please follow the instructions line by line, make sure you getthe correct logic if you don't know the python program or don'tunderstand this problem, plz don't answer it otherwise I will putbad reviews make sure you provide the source code and screenshot ofthe source code on visual studio and the output as well! do notpost someone else’s answer.
Question 1 Problem Statement: Description: Write a Python function that accepts a non-empty string, input_string as input parameter and returns a non-empty output_string based on the below logic: If the number of characters in input_string is more than 6, then initialize the output_string with the string of characters except the first character of input_string Example: input_string: 'perimeter' output_string: 'erimeter' • Otherwise, if the alphabet 'E' is present more than twice in the input_string, then initialize output_string with the number of occurrences of 'E' in input_string followed by the letter 'E' in uppercase Example: input_string: 'metecE' output_string: '3E' Note: Perform case-insensitive comparison for alphabet 'E' Otherwise, if the input_string contains only digits, then initialize output_string with half the value of input_string Example: input_string: '4224' output_string: '2112' Note: Perform integer division Otherwise, initialize the output_string with the reverse of input_string Example: input_string: '42eaq' output_string: 'qae24' Assumption: The input_string would have at least two characters Note: No need to validate the assumption The order of execution would be the same, as specified above
Sample Input and Output: input_string '24' 'EcEse' 'Ec5sd' output_string '12' '3E' 'ds5cE' Starter Code provided below: #Do NOT Change any part of the code provided to you def get_string (input string): output_string=" #Write your logic here return output_string #You can test your functionality by providing different inputs Input string = 'EcEse' output_string=get_string (input_string) print (output_string)
Question 1 Problem Statement: Description: Write a Python function that accepts a non-empty string, input_string as input parameter and returns a non-empty output_string based on the below logic: If the number of characters in input_string is more than 6, then initialize the output_string with the string of characters except the first character of input_string Example: input_string: 'perimeter' output_string: 'erimeter' • Otherwise, if the alphabet 'E' is present more than twice in the input_string, then initialize output_string with the number of occurrences of 'E' in input_string followed by the letter 'E' in uppercase Example: input_string: 'metecE' output_string: '3E' Note: Perform case-insensitive comparison for alphabet 'E' Otherwise, if the input_string contains only digits, then initialize output_string with half the value of input_string Example: input_string: '4224' output_string: '2112' Note: Perform integer division Otherwise, initialize the output_string with the reverse of input_string Example: input_string: '42eaq' output_string: 'qae24' Assumption: The input_string would have at least two characters Note: No need to validate the assumption The order of execution would be the same, as specified above
Sample Input and Output: input_string '24' 'EcEse' 'Ec5sd' output_string '12' '3E' 'ds5cE' Starter Code provided below: #Do NOT Change any part of the code provided to you def get_string (input string): output_string=" #Write your logic here return output_string #You can test your functionality by providing different inputs Input string = 'EcEse' output_string=get_string (input_string) print (output_string)