当前位置:网站首页>Section 9 of Chapter 1: the simplest user interaction
Section 9 of Chapter 1: the simplest user interaction
2022-07-21 06:24:00 【Zhongyifeng Digital Technology Co., Ltd】
Python Basic introduction ( A full set of nanny level tutorials )
Chapter one
Section 9 : The simplest user interaction
We often use programs that interact with users , For example, web login , You need to enter your own account , User interaction functions such as passwords . Let's write a simple program code for user input and output :
Follow and experience
The user login
username = input(' Please enter your user name :')
password = input(' Please enter your password :')
print(int(username))
print(int(password))
Calculator
a = input(" Please enter the first number :")
# print(type(a)) # use type To see the data type of a variable
b = input(" Please enter the second number :")
a = int(a)
b = int(b)
print(a + b)
summary :
Variable = input( Hint )
First, the prompt will be displayed on the screen , User input content . Then give the user's input to the previous variable
pit : input() The result must be a string
How to convert a string into a numeric type
py Basic data type :
Want to put xxx To whom , Just use someone to cover it
str => int int(str)
边栏推荐
- LeetCode简单题之强密码检验器 II
- 云原生(八) | Devops篇之深入Devops
- 10 GHz室内无线体域网无线信道测量与建模
- Redis sortset type
- Winform中实现窗体控件适配(自适应窗体)布局_通过C#代码方式
- MySQL 8.0 如何根据trx_id 找出整个事务的语句
- 服务器的性能监控
- Custom persistence layer framework myormframework (III) - framework implementation
- 巴比特 | 元宇宙每日必读:迪拜推出国家元宇宙战略,计划在未来五年内将元宇宙相关公司数量翻 5 倍,支持4万个虚拟工作岗位...
- GBase 8s如何处理集合的?
猜你喜欢
第一章第十三节:循环语句:for循环
第一章 第五节:注释的重要性
Leetcode simple problem strong password checker II
Redis hash type
I/o reuse: select poll epoll
Redis string type
Wps2019 all macros are forbidden. You have to pay for enabling macros. How to use them for free
I/o multiplexing function high performance framework library: libevent
自定义持久层框架MyORMFramework(三)—框架实现
[u-boot] main line analysis of u-boot operation [02] - board_ init_ f
随机推荐
Use SAP ui5 application to consume create and delete operations of OData in business application studio
Average value of sliding window of leetcode simple problem
Excel-VBA 快速上手(九、VBA 中的跳转、退出、错误、With)
I/O复用 :select poll epoll
Excel-VBA 快速上手(八、单元格对象-常见的单元格操作)
巴比特 | 元宇宙每日必读:迪拜推出国家元宇宙战略,计划在未来五年内将元宇宙相关公司数量翻 5 倍,支持4万个虚拟工作岗位...
NIO基础之三大组件
基于CLAR架构打造的宝马i3,并非是简单的“油改电”产品
ThreadPoolExecutor的keepAliveTime=0说明
How does gbase 8s handle collections?
jenkins pipeline下载代码到指定workspace
遥感影像分类工具和webgis的可视化应用
Jenkins配置插件界面中文显示「建议收藏」
I/O复用函数高性能框架库:libevent
Excel-vba quick start (VIII. Cell objects - common cell operations)
codeforces:D1. Chopping Carrots (Easy Version)【最大最小值问题 + 控制一边让另一边尽量靠近 + 思维】
工控安全PLC固件逆向三
Redis-key的层级格式
[hdlbits skimming] Verilog language -- basics
Configure static routing and rip routing protocols