首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >长生不老药,num = [9],num被分配给‘t’

长生不老药,num = [9],num被分配给‘t’
EN

Stack Overflow用户
提问于 2016-03-23 17:06:16
回答 1查看 51关注 0票数 2
代码语言:javascript
复制
iex> num = [9]
'\t'

分配一个9的列表返回'\t‘。这是什么原因?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-03-23 17:09:22

有关数据类型的更多信息,可以使用i helper in IEx

代码语言:javascript
复制
iex> i [9]  
Term
  '\t'
Data type
  List
Description
  This is a list of integers that is printed as a sequence of characters
  delimited by single quotes because all the integers in it represent valid
  ASCII characters. Conventionally, such lists of integers are referred to as
  "char lists" (more precisely, a char list is a list of Unicode codepoints,
  and ASCII is a subset of Unicode).
Raw representation
  [9]
Reference modules
  List

如果要检查原始表示形式,可以将char_lists: false传递给inspect

代码语言:javascript
复制
IO.inspect('abc', char_lists: false)
[97, 98, 99]
票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36184453

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档