zoukankan      html  css  js  c++  java
  • 流程控制之if...else

    #_*_coding:utf-8_*_

    # 如果:女人的年龄 > 30岁,那么:叫阿姨

    # age_of_girl = input('Please enter your age:')
    # age_of_girl = int(age_of_girl)
    #
    # if age_of_girl > 30:
    # print('Aunt')

    # 如果:女人的年龄 > 30岁,那么:叫阿姨,否则:叫小姐姐

    # age_of_girl = input('Please enter your age:')
    # age_of_girl = int(age_of_girl)
    #
    # if age_of_girl > 30:
    # print('Aunt')
    # else:
    # print('Beautiful Girl!')

    # 如果:女人的年龄 >= 18并且 < 22岁并且身高>170并且体重<100并且是漂亮的,那么:表白,否则:叫阿姨

    # age_of_girl = input('Please enter your age:')
    # age_of_girl = int(age_of_girl)
    # height = input('Please enter your height:')
    # height = int(height)
    # weight = input('Please enter your weight:')
    # weight = int(weight)
    # pretty = input('Are u pretty?[True or False]:')
    #
    # if age_of_girl >= 18 and age_of_girl < 22 and weight < 100 and pretty == True:
    # print("I'm falling in love")
    # else:
    # print("Hey Old Aunt!")

    # 如果:表白成功,那么:在一起,否则:打印qnmlgb的爱情
    # age_of_girl = input('Please enter your age:')
    # age_of_girl = int(age_of_girl)
    # height = input('Please enter your height:')
    # height = int(height)
    # weight = input('Please enter your weight:')
    # weight = int(weight)
    # pretty = input('Are u pretty?[Yes or No]:')


    # if age_of_girl >= 18 and age_of_girl < 22 and height>170 and weight < 100 and pretty == 'Yes':
    #
    # print("I'm falling in love")
    # girl_said = input('What the girl said?[Yes or NO]:')
    #
    # if girl_said == 'Yes':
    # print("good!")
    # else:
    # print("Oh shit! Old Aunt!")
    # else:
    # print('Hey Old Aunt!')

    # 如果:成绩》=90,那么:优秀
    # score = input('Please enter your score:')
    # score = int(score)
    # if score >= 90 :
    # print('A')
    # elif score >=80 and score < 90:
    # print('B')
    # elif score >=70 and score < 80:
    # print('C')
    # else:
    # print('Failure is the mother of success')

    #练习一:用户登录验证
    # username = input('Please enter your username:')
    # password = input('Please enter your password:')
    #
    # if username == 'oOC' and password == '123456':
    # print('login success')
    # else:
    # print('Please try again.')

    #练习二:根据用户输入内容输出其权限
    # name=input('请输入用户名字:')
    #
    # if name == 'egon':
    # print('超级管理员')
    # elif name == 'tom':
    # print('普通管理员')
    # elif name == 'jack' or name == 'rain':
    # print('业务主管')
    # else:
    # print('普通用户')

    #练习三:上班OR出去浪
    # today = input('Today is __??__:')
    #
    # if today in ['Saturday','Sunday']:
    # print('Enjoy the time!')
    # elif today in ['Monday','Tuesday','Wednesday','Thursday','Friday']:
    # print('go to work')
    # else:
    # print('''
    # Monday
    # Tuesday
    # Wednesday
    # Thursday
    # Friday
    # Saturday
    # Sunday
    # ''')

  • 相关阅读:
    Spring,SpringMVC,MyBatis,Hibernate,Servlet的生命周期,jsp有哪些内置对象,Tomcat,Cookie和Session的作用以及区别,oracle,MYSQL等面试题总结
    webpack配置react--ts项目
    防抖(debounce)和节流(throttle)
    js~eventLoop 事件循环
    在Vue 项目中使用echarts
    JS
    ImmuableJS 简单入门用法
    Redux-小案例-加一操作
    Oberver.js
    react-jsx语法
  • 原文地址:https://www.cnblogs.com/OutOfControl/p/9646821.html
Copyright © 2011-2022 走看看