注册 登录
编程论坛 Python论坛

在ipython中使用脚本发现type(x)无法显示内容

glaciya 发布于 2019-10-08 18:21, 2478 次点击
[root@linux py_project]# cat test2.py
#test2.py


print("Please input 3 values")

number1=int(input("Please input the first number"))
number1
number2=int(input("Please input the second number"))
number2
number3=int(input("Please input the third number"))
number3


minimal=number1

if number2<=minimal:

      minimal=number2

if number3<=minimal:

      minimal=number3


print("The minimum number is",minimal)




[root@linux py_project]# vim test2.py
[root@linux py_project]# cat test2.py
#test2.py


print("Please input 3 values")

number1=int(input("Please input the first number"))
number1
number2=int(input("Please input the second number"))
number2
number3=int(input("Please input the third number"))
number3


minimal=number1

if number2<=minimal:

      minimal=number2
      type(minimal)
if number3<=minimal:

      minimal=number3
      type(minimal)

print("The minimum number is",minimal)
type(minimal)



[root@linux py_project]# ipython test2.py
Please input 3 values
Please input the first number12
Please input the second number34
Please input the third number22
The minimum number is 12
6 回复
#2
wp2319572019-10-08 19:55
很有可能是那个分支没有进入
#3
glaciya2019-10-08 21:17
回复 楼主 glaciya
请问进入您说的进入是否是进入编译器?
#4
wp2319572019-10-08 21:24
啥是分支结构不知道吗?
#5
glaciya2019-10-08 23:24
回复 4楼 wp231957
请大神指点分支结构。或者抛个链接我好好看看。
#6
wp2319572019-10-09 08:25
回复 5楼 glaciya
话说 type这个函数 貌似只有再shell环境下有效   再运行环境下无效   所以不显示正常
#7
glaciya2019-10-09 20:26
回复 6楼 wp231957
谢谢,已经理解。
1