您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

Python:获取列表中第一个字符串的第一个字符?

Python:获取列表中第一个字符串的第一个字符?

你几乎是对的。最简单的方法

mylist[0][0]   # get the first character from the first item in the list

mylist[0][:1]  # get up to the first character in the first item in the list

也可以。

你想 的第一个字符(字符零)后,未 的第一个字符(字符零),这是以后有什么在你的问题的手段的代码

python 2022/1/1 18:30:24 有193人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶