46 Simple Python Exercises-Very simple exercises
Posted 米小乐1122
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了46 Simple Python Exercises-Very simple exercises相关的知识,希望对你有一定的参考价值。
4、Write a function that takes a character (i.e. a string of length 1) and returns True if it is a vowel, False otherwise.
def if_vowel(a):
a=a.lower()
if a in(‘a‘,‘e‘,‘i‘,‘o‘,‘u‘):
return True
else:
return False
print(if_vowel(‘A‘))
以上是关于46 Simple Python Exercises-Very simple exercises的主要内容,如果未能解决你的问题,请参考以下文章
46 Simple Python Exercises (前20道题)
46 Simple Python Exercises-Higher order functions and list comprehensions
markdown python,exercise,iterator
Python基础lpthw - Exercise 40 模块类和对象
Data Analysis with Python : Exercise- Titantic Survivor Analysis | packtpub.com