2019-01-19
阅读量:
746
input与raw_input有什么区别(2)
s2 = raw_input("Enter input to test raw_input() function: ")
print type(s2)
s3 = raw_input("Enter input to test raw_input() function: ")
print type(s3)
# 3 inputs using input() function,
# after which data type of the value
# entered is displayed
s4 = input("Enter input to test input() function: ")
print type(s4)
s5 = input("Enter input to test input() function: ")
print type(s5)
s6 = input("Enter input to test input() function: ")
print type(s6)
Input:
Hello
456
[1,2,3]
45
"goodbye"
[1,2,3]
Output:
Enter input to test raw_input() function: <type 'str'>
Enter input to test raw_input() function: <type 'str'>
Enter input to test raw_input() function: <type 'str'>
Enter input to test input() function: <type 'int'>
Enter input totest input() function: <type 'str'>
Enter input to test input() function: <type 'list'>






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论