Write a method center that takes a string st and a field size width and returns
ID: 3569050 • Letter: W
Question
Write a method center that takes a string st and a field size width and returns a centered version of the string within the given field. Add spaces to each side of st to center it. Note: * You can find the number of characters in a string with len(st). * st is guaranteed to contain an even number of characters. * width is also guaranteed to be even. * width may be less than len(st).
def center(st, width):
return ""
_____________________________
Write a function that takes a string as input and returns a string composed of only the odd indexes of the string. Note: enumerate() is not available.
def odd_string(data):
pass
________________________
Given a string as input, count the vowels and return the result.
def count_vowels(a_string):
pass
________________________
Classes are typically between one and four credits. An advisor (who doesn't know how to use Excel) has been noting student credit hours as a string of numbers that you need to add up. Create a function called credit_hours that takes a string as input and adds the numbers 1-4 in the string. For example, "4342241" results in 20 credit hours.
def credit_hours(data):
pass
______________________
You will receive a data string and a single letter as input. Determine what percentage of the string is composed using the letter and return this as the output.
def letter_frequency(data, letter):
pass
_____________________
You will get a string of parenthesis and other letters. Return True if the number of opening parenthesis is the same as the number of closing parenthesis (the parenthesis don't have to "match".)
def paren_parity(z):
pass
Explanation / Answer
Can you increase the points to 1500 or above .As there are several parts in this question. 300*6=1800 points
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.