python learning foundation -2 -3 python conditional statement (if simple usage 1)

Conditional statements of principle:

 

 

2. For example: size ratio  

#!/usr/bin/env python
#  -*- coding:utf8 -*-


a=input("请输入a:")
b=input("请输入b:")

if a > b:
    print("a > b")
elif a < b:
    print("a < b")
else:
    print("a = b")

print("---------------")
input("Press enter End " )
Please enter a: 9 
enter B: . 1 
A > B
 --------------- 
press enter End 

Process finished with exit code 0

With the if statement and elif statements.

 

 

Remark: The code is written in pycharm inside. I want to download friends can go to Baidu home page search pycharm.

 

Link: https: //pan.baidu.com/s/1kYAWRUKMAMNuZpVZ69G6pA
extraction code: psjr
period: seven days.


To share a python manual tutorial books (donated pygame plug-in)

Guess you like

Origin www.cnblogs.com/liujinjing521/p/10976282.html