Python if...else 语句的用法

 时间:2026-04-23 17:53:36

1、1Python if...else 语句的用法

Python if...else 语句的用法

2、2#程序解读:输入一个数字,如果小于10,输出平方值,如果大于10输出立方值

Python if...else 语句的用法

3、3ts1 = int(input("输入一个数字: "))#提示

Python if...else 语句的用法

4、4如果小于10,输出平方值

if ts1<10:#如果小于10,输出平方值

   dis1 = ts1**2

   print ("平方值",dis1)

Python if...else 语句的用法

5、else:#如果大于10输出立方值

   dis1 = ts1**3

   print ("立方值",dis1)

Python if...else 语句的用法

6、输入一个数字,如果小于10,输出平方值,如果大于10输出立方值

Python if...else 语句的用法

Python if...else 语句的用法

  • 如何将Access中的数据导入进Excel
  • Access查询的数据如何导出为Excel
  • 【校园指南】山西医科大学汾阳学院校园卡指南
  • js中字符串和函数的使用注意事项
  • ACCESS简体开发繁体应用--简繁系统语言转换
  • 热门搜索
    智力发育迟缓怎么办 114是什么电话 产后如何去妊娠纹 2月28日是什么星座 如何怀孕快 如何清洗抽油烟机 课余生活 窝沟封闭是什么意思 t3t4是什么 如何唱歌不跑调