实验1 Python开发环境使用和编程初体验
2022/3/26 1:23:05
本文主要是介绍实验1 Python开发环境使用和编程初体验,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
print('hey, u') print('hey', ' u') x,y,z = 1,2,3 print(x, y, z) print('x = %d, y = %d, z = %d' %(x,y,z)) print('x = {}, y = {}, z = {}'.format(x,y,z)) print(f'x = {x}, y = {y}, z = {z}') print(x) print(y) print(z) print(x, end=' ') print(y, end=' ') print(z)
x1, y1 = 1.2, 3.57 x2, y2 = 2.26, 8.7 print('{:-^40}'.format('输出1')) print('x1 = {}, y1 = {}'.format(x1, y1)) print('x2 = {}, y2 = {}'.format(x2, y2)) print('{:-^40}'.format('输出2')) print('x1 = {:.1f}, y1 = {:.1f}'.format(x1, y1)) print('x2 = {:.1f}, y2 = {:.1f}'.format(x2, y2)) print('{:-^40}'.format('输出3')) print('x1 = {:<15.1f}, y1 = {:<15.1f}'.format(x1, y1)) print('x2 = {:<15.1f}, y2 = {:<15.1f}'.format(x2, y2)) print('{:-^40}'.format('输出3')) print('x1 = {:>15.1f}, y1 = {:>15.1f}'.format(x1, y1)) print('x2 = {:>15.1f}, y2 = {:>15.1f}'.format(x2, y2))
name1, age1 = 'Bill', 19 name2, age2 = 'Hellen', 18 title = 'Personnel Information' print(f'{title:=^40}') print(f'name: {name1:10}, age: {age1:3}') print(f'name: {name2:10}, age: {age2:3}') print(40*'=')
这篇关于实验1 Python开发环境使用和编程初体验的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-21Python编程基础教程
- 2024-11-20Python编程基础与实践
- 2024-11-20Python编程基础与高级应用
- 2024-11-19Python 基础编程教程
- 2024-11-19Python基础入门教程
- 2024-11-17在FastAPI项目中添加一个生产级别的数据库——本地环境搭建指南
- 2024-11-16`PyMuPDF4LLM`:提取PDF数据的神器
- 2024-11-16四种数据科学Web界面框架快速对比:Rio、Reflex、Streamlit和Plotly Dash
- 2024-11-14获取参数学习:Python编程入门教程
- 2024-11-14Python编程基础入门