0%

Python入门day01

###前言

python是面向对象的高解释性编程语言,与其他语言相比设计更接近英语,更可读。

###环境搭建

下载python:https://www.python.org/

编写代码软件Vs code:Visual Studio Code - Code Editing. Redefined

具体安装过程就不演示了,跟安装软件一样。

输入(input)输出(print)函数

####print函数的运用

  1. 打印内容
1
2
3
4
#print函数格式:print('内容')
print('hello')
print("hello")
print() #打印一行空行
  1. 格式化代码
1
2
3
4
5
6
7
#格式化代码(美化)
print("hello")
#print()打印一个空行
print()
print('world')
#/n 换行作用
print('blank line \nin the middle of tring')

####input函数

1
2
3
4
#input函数格式:自定义变量 = input('提示用户输入的内容:')
#用户输入结果存入name变量中,print打印name结果
name = input('prles: ')
print(name)