Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 807 Bytes

File metadata and controls

30 lines (19 loc) · 807 Bytes

第一篇


从基础的指令开始吧

输入及输出 input()&print()

  • input

    在输入的时候可以编辑成 n=input()。 此时,想要调用刚刚输入进去的参数或者字符串的时候,直接调用'n'即可。

    这种输入方式,想要获取整数就要写成 n=int(input())

    还可以在要求输入的时候写成 n=input('请输入:')

  • print

在使用print()进行输出的时候可以通过'',"".引号来将字符串文本直接输出出来。不同的字符串之间可以用逗号分割,逗号的地方直接生产空格。


布尔运算符(and,or,not)

  • and

and 前后的布尔值(true,false),同时为true是返回true

  • or

or 前后有一者为true,即返回true

  • not

not 运算返回后面跟着的布尔值的相反值