Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

저장소

파이썬 scanf, scanner 본문

Python

파이썬 scanf, scanner

김연호님 2018. 1. 29. 22:01

파이썬은 raw_input(), input()을 씀



import os


userinput = raw_input("how old are you? ")

 

print  userinput, "data_type : ", type(userinput)

 

uinput = input("how tall are you? ")

 

print uinput, "data_type : ", type(uinput)


------------------------------------------

how old are you? 18

18 data_type :  <type 'str'>

how tall are you? 170

170 data_type :  <type 'int'>

------------------------------------------


raw_input()은 str, 

input()은 int, float을 받음

Comments