Python学习---Python数据类型1206
2023-09-11 14:20:11 时间
1.1. 字符串格式化
字符格式化输出
占位符 %s s = string
%d d = digit 整数
%f f = float 浮点数,约等于小数
#version: python3.2.5 #author: ‘FTL1012‘ #time: 2017/12/6 17:20 #name=hhh 这个是错误的,因为没有用单引号/双引号括起来,当做一个变量赋值给 name = input("please input the name:") age = input("please input the age:") tel = input("please input the tel:") if age.isdigit(): if tel.isdigit(): age = int(age) #age必须是数字 tel = int(tel) #tel必须是数字 else: exit ("something wrong...") msg = ''' ---------info of %s --------- name: %s age : %d tel : %d ---------end of %s --------- ''' %(name, name, age, tel, name) print(msg)
1.2. Python的数据类型
相关文章
- 机器学习-kmeans(实现步骤、sklearn实现、python自实现、优缺点)
- Python性能鸡汤
- 超全Python学习路线图+14张思维导图,让python初学者不走弯路
- 学习Python之后,可以做哪些兼职?Python入门!
- 学习Python发展前景如何?
- 小白学数据 | 28张小抄表大放送:Python,R,大数据,机器学习
- urllib与urllib2的学习总结(python2.7.X): python urllib与urllib2
- 《Python机器学习实践指南》——第1章 Python机器学习的生态系统
- Python学习之DateTime、TimeDelta、Strftime(Format)及其示例
- 萌新学习Python爬取B站弹幕+R语言分词demo说明
- Python 数据分析教程之如何验证线性回归的假设,线性回归的假设是什么?以及如何用python验证它们?
- Python学习---IO的异步[asyncio +aiohttp模块]
- Python学习---django多对多之Djanog默认表学习
- Python学习---深入编码学习1225
- Python实例---游戏人生[类的学习]
- Python学习---装饰器的学习1210
- Python学习---Python下[set集合]的学习
- Python学习---Python下[元组]的学习
- Python 机器学习 之 使用 sciki-learn 进行简单的文本特征提取
- 【机器学习】:Kmeans均值聚类算法原理(附带Python代码实现)
- 学习python第四天——Oracle查询
- 学习python第四天——Oracle分组
- 【python 学习】——pycharm终端解释器和Python解释器配置