# 0812 Input and Output Benson Chiu @ FDCS 8th X 7th <!-- Put the link to this slide here so people can follow --> slide: https://hackmd.io/@benson-elementary-cpp/SJhk1Pyet --- ## Input ```python= InputString = input("一串提示文字") ``` - input function will return **a string type** object ```python= a = input() #Suppose we input 1234 print(type(a)) #It will be a string '1234' b = int(a) print(type(b)) #It will be an interger 1234 ``` --- ## Special tactics of Input ```python= a,b,c = input().split() a = int(a) b = int(b) c = int(c) ``` --- ## Output ```python= print('a','b','c',sep=',',end='|very good \n') ``` ![](https://i.imgur.com/QsCFCtY.png =x50) > By default, sep=' ', end='\n' --- ## Escape sequence | Escape Sequence | Meaning | |:---------------:| ----------- | | \\' | ' | | \\" | " | | \n | end of line | | \\\ | \ | For more examples of Escape sequence, please check [The reading material](https://www.python-ds.com/python-3-escape-sequences)
{"metaMigratedAt":"2023-06-16T06:44:26.470Z","metaMigratedFrom":"YAML","title":"0812 Input and Output","breaks":true,"description":"View the slide with \"Slide Mode\".","slideOptions":"{\"spotlight\":{\"enabled\":true}}","contributors":"[{\"id\":\"29625303-a0ab-4215-b54d-35c95f11006b\",\"add\":1260,\"del\":33}]"}
    191 views
   Owned this note