美文网首页
Python作业2

Python作业2

作者: 小鱼儿_Y | 来源:发表于2020-08-05 00:04 被阅读0次

1、什么是BIF?
Python中的BIF全称为Built_in Functions,表示内置函数的意思。为了方便程序员快速地编写脚本程序,Python中提供了很多内置函数,只需要直接调用就可以。
调用函数:
>>> dir(__builtins__) 括号里面的__是两个下划线
['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'BlockingIOError', 'BrokenPipeError', 'BufferError', 'BytesWarning', 'ChildProcessError', 'ConnectionAbortedError', 'ConnectionError', 'ConnectionRefusedError', 'ConnectionResetError', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'EnvironmentError', 'Exception', 'False', 'FileExistsError', 'FileNotFoundError', 'FloatingPointError', 'FutureWarning', 'GeneratorExit', 'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError', 'InterruptedError', 'IsADirectoryError', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError', 'None', 'NotADirectoryError', 'NotImplemented', 'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecationWarning', 'PermissionError', 'ProcessLookupError', 'RecursionError', 'ReferenceError', 'ResourceWarning', 'RuntimeError', 'RuntimeWarning', 'StopAsyncIteration', 'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError', 'TimeoutError', 'True', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning', 'ValueError', 'Warning', 'ZeroDivisionError', '_', 'build_class', 'debug', 'doc', 'import', 'loader', 'name', 'package', 'spec', 'abs', 'all', 'any', 'ascii', 'bin', 'bool', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', 'compile', 'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'exit', 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip']

查看某个函数的具体功能,使用help( )就可以,例如:help(input)
2、Python是区分大小写的,所以也就意味着 "I Love" 与 "i love" 是不同的。
3、Python中代码的缩进很重要!!!
4、Python中=表示赋值,i = 3表示将右边的3赋值给左边的 i
==表示等于的意思,3==4 表示3与4相等,答案当然是False
5、编程:
编写一个小程序,要求用户输入姓名,并打印 “姓名+您好!”

name = input("请输入你的姓名:")
print(name + "您好" + "!")

请输入你的姓名:xiaoyuer
xiaoyuer您好!

学习的小甲鱼的视频课程笔记

相关文章

  • Python作业2

    1、什么是BIF?Python中的BIF全称为Built_in Functions,表示内置函数的意思。为了方便程...

  • 【Python爬虫】作业2

    基础题a = 10b = 3下面三题分别运算后 c=? ,以及 c 的类型c = a/b - ac = a/b *...

  • Python 学习笔记 062

    嗯 回到正题,接着千峰Python网课的学习 第十六章 python2 和python3 的区别 1.昨日作业 将...

  • 【Python爬虫】-第一个脚本

    作业内容完成第一个python脚本 Hello,World输出。 作业代码 实现效果(Pycharm) QQ截图2...

  • 5.23计划

    1.打卡✔ 2.英语考试✔ 3.线代作业✘ 4. python 作业✔ 5.语文作业✔ 今日小结: 1.今天发现了...

  • 搜企网爬虫作业

    作业要求 (1)csv文件数据写入(2)mysql 操作,python mysql操作 这个需要安装mysql以及...

  • 【Python爬虫】-笨办法学Python习题01-10

    一、作业内容 笨办法学 Python 习题0-10以及加分题。 二、作业代码 题目1-2(包括加分题),代码如下:...

  • python作业-20170601

    作业:(1)csv文件数据写入(2)mysql 操作,python mysql操作 这个需要安装mysql以及p...

  • 深度学习-从零开始(2) - LinearRegression

    本章背景 本章是来源于coursera课程 python-machine-learning中的作业2内容。 本章内...

  • 保证书

    坚持自学 1 工作日每天三个小时认真学习python 2 休息日每天5个小时认真学习python 3 自己写作业 ...

网友评论

      本文标题:Python作业2

      本文链接:https://www.haomeiwen.com/subject/odivrktx.html