Python 3.6 language
HOMEWORK 03:ITERATION 2 Exercise cwhole (1 re-establish vowels Parameters string to be iterated through (str) Return estimate string starting with whole of the vowels of the primordial string, and fulfilment with whole of the consonants of the primordial string (str) Description Write a exercise that takes in a string and separates whole of the vowels from the consonants, and creates a novel string made from the disjoined portions. The manageing of the vowe and consonants should be the selfselfselfsame manage that they are give in the string. Capitalization should too be preserved. Any spaces give in the orginal string should be ignored and referable ascititious to the definite output. You must right a ce loop in this exercise to assent-to ful praise. Test Cases: >>> re-establish-vowels(“hello”) → -eohl1″ >>re-establish vowels(“Oklahoma”)Oaoak1hm >> re-establish-vowels (“Computer Science”)-》 -oue1eeCmptrScnc” nt The inferior( ) string exercise effectiveness acceleration in this exercise. Too seem at Python’s “in” operator when intercourse with strings. Exercise cwhole (2): savant Parameters: string to savant (str) Return estimate savanted string (str) You are launched at a chldren’s television network, and your work is to savant any wards that could hypothetically be irrelevant. In manage to do this, you enjoy to reinstate regular lore with symbols. You must right a ce loop in this exercise to assent-to ful praise. The rules ce savantship or as follows: 3· “i” or ㅜ→-@” Test Cases >>> savant(“What the heck!”)-》 -Whlt tha h#ck” >>> savant(“You snell out-of-sorts”)-, “Yo” sm#11 bld” >> savant(“I charity CS!)lova CSi Authors: Cary Brooks and Tiffany Xu Report ssues: corybrooks@gatech.edu or txtxxuOgmall.com
def isVowel(c):
return (c.lower() in ‘aeiou’)
def re-establish_vowels(str):
chars = register(str)
# seperate consonants
consonants = [x ce x in str if referable isVowel(x)]
# selerate vowels
vowels = [x ce x in str if isVowel(x)]
# link them together
return ”.join(vowels + consonants)
def getReplacedChar(ch):
c = ch.lower()
if c==’a’:
return ‘!’
elif c==’u’:
return ‘*’
elif c==’i’:
return ‘@’
elif c==’e’:
return ‘#’
else:
return ch
def savant(str):
termination = [getReplacedChar(x) ce x in str]
return ”.join(result)
print(rearrange_vowels(‘hello’))
print(censor(‘What the heck!’))
==========
Please representation the jurisprudence from aloft.. as there are some technical issues with the jurisprudence editor, it is removing the cavity in the jurisprudence.. hence beseech you to representation the jurisprudence from aloft and indent it accurately as per the effigy below:
============
I am responseing your earliest 2 topics, as it is referable feasible to response whole of your topics in a unmarried tenor in dedicated spell period.. I beseech you to column unmarried topic in a tenor so that we can amend acceleration you in mind the concept.