热线电话:13121318867

登录
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'>
17.3615
1
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子