当前位置:网站首页>sys. stdin. ReadLine and readlines and input ()
sys. stdin. ReadLine and readlines and input ()
2022-04-21 07:58:00 【xx_ xjm】
1:sys.stdin.readline: Only from cmd Read a line of input , After reading, exit the input , Program continues
2:sys.stdin.readlines: It can be downloaded from cmd Read multiple lines of input , But how to terminate the exit is unclear , On the Internet ctrl+d perhaps ctrl+z Neither. , Add one more enter Not good either. ( I was in pycharm in , Connect to remote server linux System ), It's strange anyway
3: You can read multiple lines in the following way , And press enter end ( Add strip Because the default end will have \n):

4: How to convert an input number from a string to a number , Refer to the method in the figure below ( Reference from :python Accept user input sys.stdin.readline() as well as input_qq61791a45522ab Technology blog _51CTO Blog ):
Be careful , For yes list(map(int/float, str/list))

5:input(): Be similar to readline() Only one line can be entered , But there won't be \n ending , So don't add strip() function
版权声明
本文为[xx_ xjm]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210700383653.html
边栏推荐
- Usage notes of Axure product prototype tool
- Why is the primary key matching setting in MySQL showing that I am wrong?
- Oracle SQL script record
- C# asp. Net calling Baidu character recognition interface
- Self made webserver from scratch (XV) -- the log base part is completed, and the practical widget double-buffering optimizes the asynchronous write performance
- Zephyr IOT operating system column summary
- PHP format numbers
- Solution of losing Beijing time zone in window system
- 2022-04-20:小团去参加军训,军训快要结束了, 长官想要把大家一排n个人分成m组,然后让每组分别去参加阅兵仪式, 只能选择相邻的人一组,不能随意改变队伍中人的位置, 阅兵仪式上会进行打分,其中
- Enum 枚举类型
猜你喜欢

Flutter first experience

从零开始学习C语言日记——DAY27扫雷

Valentina Studio Pro for Mac(mac数据库管理软件)

Shortcut keys for batch modification of variable name and batch replacement code in idea

leetcode题目--120.三角形最小长度和,简单dp

如何修改 Rancher Server 的 IP 地址

IIC bus design ① - IIC communication protocol

Hackmyvm integrated target | driftingblues-9 (end)

2022年电工(初级)考试题库及答案

数学实验——函数绘图实验
随机推荐
Pycharm's latest method of importing PIL Library
【以太网交换安全】--- 端口隔离运行原理及二层隔离三层通信实例配置讲解
类中的泛型以及泛型类型
如何修改 Rancher Server 的 IP 地址
Acrobat Pro DC 教程::如何使用文本和图片文件创建 PDF?
迅为i.MX6Q开发板Openwrt 文件系统构建
Usage notes of Axure product prototype tool
物联网操作系统Zephyr(入门篇)之1.0 Zephyr简介
AnalyticDB MySQL版中不支持int嘛?
torch中permute()函数用法补充内容(矩阵维度变化详细过程)
Introduction to zephyr 1.0 of Internet of things operating system zephyr (Introduction)
基于JeecgBoot的v-has权限控制
Leetcode 707 Design linked list
为什么mysql里面设置符合主键它显示我错了?
Enum 枚举类型
Vim插件管理插件Vim-plug
V-has permission control based on jeecgboot
动态规划--LC474.一和零
注解功能补充
《Qt 5.12实战》简介