Subject Computer Science Python Programming


Check the file: Questions.pdf

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

def string_can_be_built(string_a,string_b):
    result = False
    ##Your code goes here
    # the easiest way to check if the string_a could be contained within string_b is to check
    # characters contained in a string_b
    # if the set of all characters contained in a string_a is the subset of the set of all
    # convert string_a to a set if characters
    # make a set of all characters contained withing string a
    a = {s for s in string_a.lower() if s.isalpha()}
    # check if a is subset of the string_b
    result = a.issubset(string_b.lower())


def igpay_atinlay(ingstray):
    # remove all spaces from the provided string
    # and check if the provided string contains anything other than letters
    if not ingstray.replace(" ", "").isalnum():
       return ""
    vowels = ["a", "e", "i", "o", "u"] # make a list of vowels
    words = ingstray.split(" ") # split a string into words
    pig_english = ""
    # iterate over all words
    for word in words:
       # if the word begins with a vowel add the "yay" to the end of the word
       if word[0] in vowels:
            word = word + "yay"
            # if a word begins with a consonant
            # find the first vowel in a word and split the word
            # into strings before the first vowel and after the first vowel
            for char in word:
                if char in vowels:
                   head, tail = word.split(char, 1)...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Assisting Tutor
Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats