sex = input("please input your gender:")if sex == "man": print("I would like to makefriend with you")elif sex == "girl": print("I would like have a little monkey with you")else: print("are you kidding me?")
python里面采用强制缩进,来指定作用域。类似于java里面的{}括起来的部分。如果没有缩进的话,python就会语法错误。
python只会认为要执行if下有缩进的那些语句。