2017.5.4 if_pc_1

作者: LorryZ | 来源:发表于2017-05-17 06:38 被阅读2次

    alien_color = 'red'

    if alien_color == 'green':

        print('you got five points!')

    else:

        print('you got no point!')

    alien_color_1 = 'red'

    if alien_color_1 == 'green':

        print('You got five points!')

    else:

        print('You got ten point!')

    alien_color_2 = 'red'

    if alien_color_2 == 'green':

        print('You got five points!')

    elif alien_color_2 == 'yellow':

        print('You got ten point!')

    elif alien_color_2 == 'red':

        print("You got 15 points!")

    fruits = ['apple','banana','orange','grape','peach']

    if 'apple' in fruits:

        print('You really like it!')

    if 'banana' in fruits:

        print('You really like it!')

    if 'orange' in fruits:

        print('You really like it!')

    if 'grape' in fruits:

        print('You really like it!')

    if 'peach' in fruits:

        print('You really like it!')

    for fruit in fruits:

        print("You really like " + fruit + '.')

    相关文章

      网友评论

        本文标题:2017.5.4 if_pc_1

        本文链接:https://www.haomeiwen.com/subject/njkrtxtx.html