Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is my code so far, I need help: 1 . Create the function is_vowel . It must use anifstatement(s) def is_vowel (v) : #

This is my code so far, I need help:

1. Create the functionis_vowel. It must use anifstatement(s)

def is_vowel(v): # v is a letter # return True if v is a vowel 

Notes:

  • solve the problem usingONLYselection statements (e.g.if,elif,else) with boolean expressions (e.g. do not use theinoperator)
  • You can use the functionslower()orupper()in your solution to help manage all the possibilities. Bothlowerandupperare functions on the string type. When a function belongs to a type we call themmethods.
print('A'.lower(), 'a'.upper()) 

2. Create a functionis_a_vowel. It must use theinoperator to solve the same problem:

def is_a_vowel(v): # v is a letter # return True if v is a vowel 

This is my code so far, I need help:

Thanks

print("abcdefg".index('c'))

#want a quick sequence of numbers, try using range

#membership test = if this in this, print the index of that thing in its list

# don't really get "method"

#converting and checking's

#code will differ. Checking is == the tyope im changing it to while converting is initial thing == the typechange(x)

def is_vowel(V):

V = [a,e,i,o,u]

if V == vowel:

return True

def is_a_vowel(V):

V == letter

if V == letter:

return True

def count_vowels(V, len(V)):

lis = list("V") #turn the list into a string

if is_a_vowel(V) == letter:

return True

else:

return False

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Programming questions

Question

=+ What experiences and/or degrees differ among members?

Answered: 1 week ago