Issues with a if/else loop in Python

前端 未结 6 1845
萌比男神i
萌比男神i 2020-12-04 03:37

I am trying to make this Pig Latin translator in Python and it was working well until I tried to downsize it a bit.

Can someone please take a look at this code and t

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 04:22

    You should replace the string:

    if low_original[0] == 'a' or 'e' or 'i' or 'o' or 'u':
    

    with:

    if low_original[0] in ('a', 'e', 'i', 'o', 'u'):
    

提交回复
热议问题