当前位置: 首页 > news >正文

外贸网站优化排名优秀营销软文范例100字

外贸网站优化排名,优秀营销软文范例100字,近期十大热点新闻,wordpress 模板 外贸文章目录 1)映射代理(不可变字典)2)dict 对于类和对象是不同的3) any() 和 all()4) divmod()5) 使用格式化字符串轻松检查变量6) 我们可以将浮点数转换为比率7) 用globals()和locals()显示现有的全局/本地变量8) import() 函数9) …

文章目录

  • 1)映射代理(不可变字典)
  • 2)dict 对于类和对象是不同的
  • 3) any() 和 all()
  • 4) divmod()
  • 5) 使用格式化字符串轻松检查变量
  • 6) 我们可以将浮点数转换为比率
  • 7) 用globals()和locals()显示现有的全局/本地变量
  • 8) import() 函数
  • 9) Python中的无限值
  • 10) 我们可以使用 ‘pprint’ 来漂亮地打印东西
  • 11) 我们可以在Python中打印彩色输出
  • 12) 创建字典的更快方法
  • 13) 我们可以在Python中取消打印的内容
  • 14) 对象中的私有变量并不是真正的私有
  • 15) 我们可以使用’type()'创建类
      • 关于Python技术储备
        • 一、Python所有方向的学习路线
        • 二、Python基础学习视频
        • 三、精品Python学习书籍
        • 四、Python工具包+项目源码合集
        • ①Python工具包
        • ②Python实战案例
        • ③Python小游戏源码
        • 五、面试资料
        • 六、Python兼职渠道


1)映射代理(不可变字典)


映射代理是创建后无法更改的字典。如果我们不希望用户能够更改我们的值,就可以使用它。

from types import MappingProxyTypemp = MappingProxyType({'apple':4, 'orange':5})
print(mp)# {'apple': 4, 'orange': 5}

如果我们尝试更改映射代理中的内容,就会出现错误。

from types import MappingProxyTypemp = MappingProxyType({'apple':4, 'orange':5})
print(mp)'''
Traceback (most recent call last):File "some/path/a.py", line 4, in <module>mp\['apple'\] = 10~~^^^^^^^^^
TypeError: 'mappingproxy' object does not support item assignment
'''

2)dict 对于类和对象是不同的


class Dog:def \_\_init\_\_(self, name, age):self.name = nameself.age = agerocky = Dog('rocky', 5)print(type(rocky.\_\_dict\_\_)) # <class 'dict'>
print(rocky.\_\_dict\_\_) # {'name': 'rocky', 'age': 5}print(type(Dog.\_\_dict\_\_)) # <class 'mappingproxy'>
print(Dog.\_\_dict\_\_)
# {'\_\_module\_\_': '\_\_main\_\_', 
# '\_\_init\_\_': <function Dog.\_\_init\_\_ at 0x108f587c0>, 
# '\_\_dict\_\_': <attribute '\_\_dict\_\_' of 'Dog' objects>, 
# '\_\_weakref\_\_': <attribute '\_\_weakref\_\_' of 'Dog' objects>, 
# '\_\_doc\_\_': None}

对象的 dict 属性是普通字典,而类的 dict 属性是映射代理,它们本质上是不可变字典(无法更改)。

3) any() 和 all()


any(\[True, False, False\]) # Trueany(\[False, False, False\]) # Falseall(\[True, False, False\]) # Falseall(\[True, True, True\]) # True

any() 和 all() 函数都接受可迭代对象(例如列表)。

any() 如果至少有一个元素为 True,则返回 True。

all() 只有当所有元素都为 True 时才返回 True。

4) divmod()


内置的divmod()函数可以同时执行//和%运算符。

quotient, remainder = divmod(27, 10)​​​​​​​print(quotient)  # 2
print(remainder) # 7

这里,27 // 10 的值为2,而 27 % 10 的值为7。因此,返回元组2,7。

5) 使用格式化字符串轻松检查变量


name = 'rocky'
age = 5string = f'{name=} {age=}'
print(string)# name='rocky' age=5

在格式化字符串中,我们可以在变量后面添加 = 以使用 var_name=var_value 的语法打印它。

6) 我们可以将浮点数转换为比率


print(float.as\_integer\_ratio(0.5))    # (1, 2)print(float.as\_integer\_ratio(0.25))   # (1, 4)print(float.as\_integer\_ratio(1.5))    # (3, 2)

内置的 float.as_integer_ratio() 函数允许我们将浮点数转换为表示分数的元组。但有时它会表现得很奇怪。

print(float.as\_integer\_ratio(0.1))    # (3602879701896397, 36028797018963968)print(float.as\_integer\_ratio(0.2))    # (3602879701896397, 18014398509481984)

7) 用globals()和locals()显示现有的全局/本地变量


x = 1
print(globals())# {'\_\_name\_\_': '\_\_main\_\_', '\_\_doc\_\_': None, ..., 'x': 1}

内置的 globals() 函数返回一个包含所有全局变量及其值的字典。

def test():x = 1y = 2print(locals())test()# {'x': 1, 'y': 2}

内置函数 locals() 返回一个包含所有局部变量及其值的字典。

8) import() 函数


import numpy as np
import pandas as pd

^ 导入模块的常规方式。

np = \_\_import\_\_('numpy')
pd = \_\_import\_\_('pandas')

^ 这与上面的代码块执行相同的操作。

9) Python中的无限值


a = float('inf')
b = float('-inf')

^ 我们可以定义正无穷和负无穷。 正无穷大于所有其他数字,而负无穷小于所有其他数字。

10) 我们可以使用 ‘pprint’ 来漂亮地打印东西


from pprint import pprintd = {"A":{"apple":1, "orange":2, "pear":3}, "B":{"apple":4, "orange":5, "pear":6}, "C":{"apple":7, "orange":8, "pear":9}}pprint(d)

11) 我们可以在Python中打印彩色输出


我们需要先安装colorama。

from colorama import Foreprint(Fore.RED + "hello world")
print(Fore.BLUE + "hello world")
print(Fore.GREEN + "hello world")

12) 创建字典的更快方法


d1 = {'apple':'pie', 'orange':'juice', 'pear':'cake'}

^ 正常的方式

d2 = dict(apple='pie', orange='juice', pear='cake')

^更快的方法。这与上面的代码块完全相同,但我们输入较少的引号。

13) 我们可以在Python中取消打印的内容


CURSOR\_UP = '\\033\[1A'
CLEAR = '\\x1b\[2K'print('apple')
print('orange')
print('pear')
print((CURSOR\_UP + CLEAR)\*2, end='') # this unprints 2 lines
print('pineapple')

14) 对象中的私有变量并不是真正的私有


class Dog:def \_\_init\_\_(self, name):self.\_\_name = name@propertydef name(self):return self.\_\_name

这里,self.__name变量应该是私有的。我们不应该能够从类外部访问它。但实际上我们可以。

rocky = Dog('rocky')
print(rocky.\_\_dict\_\_)    # {'\_Dog\_\_name': 'rocky'}

我们可以使用 dict 属性来访问或编辑这些属性。

15) 我们可以使用’type()'创建类


classname = type(name, bases, dict)

name 是一个字符串,代表类的名称

bases 是包含类父类的元组

dict 是包含属性和方法的字典

class Dog:def \_\_init\_\_(self, name, age):self.name = nameself.age = agedef bark(self):print(f'Dog({self.name}, {self.age})')

^ 以正常方式创建一个 Dog 类

def \_\_init\_\_(self, name, age):self.name = nameself.age = agedef bark(self):print(f'Dog({self.name}, {self.age})')Dog = type('Dog', (), {'\_\_init\_\_':\_\_init\_\_, 'bark':bark})

^ 使用 type() 创建与上面完全相同的 Dog 类


关于Python技术储备

学好 Python 不论是就业还是做副业赚钱都不错,但要学会 Python 还是要有一个学习规划。最后大家分享一份全套的 Python 学习资料,给那些想学习 Python 的小伙伴们一点帮助!

保存图片微信扫描下方CSDN官方认证二维码免费领取【保证100%免费

一、Python所有方向的学习路线

Python所有方向的技术点做的整理,形成各个领域的知识点汇总,它的用处就在于,你可以按照上面的知识点去找对应的学习资源,保证自己学得较为全面。
在这里插入图片描述

二、Python基础学习视频

② 路线对应学习视频

还有很多适合0基础入门的学习视频,有了这些视频,轻轻松松上手Python~在这里插入图片描述
在这里插入图片描述

③练习题

每节视频课后,都有对应的练习题哦,可以检验学习成果哈哈!
在这里插入图片描述
因篇幅有限,仅展示部分资料

三、精品Python学习书籍

当我学到一定基础,有自己的理解能力的时候,会去阅读一些前辈整理的书籍或者手写的笔记资料,这些笔记详细记载了他们对一些技术点的理解,这些理解是比较独到,可以学到不一样的思路。
在这里插入图片描述

四、Python工具包+项目源码合集
①Python工具包

学习Python常用的开发软件都在这里了!每个都有详细的安装教程,保证你可以安装成功哦!
在这里插入图片描述

②Python实战案例

光学理论是没用的,要学会跟着一起敲代码,动手实操,才能将自己的所学运用到实际当中去,这时候可以搞点实战案例来学习。100+实战案例源码等你来拿!
在这里插入图片描述

③Python小游戏源码

如果觉得上面的实战案例有点枯燥,可以试试自己用Python编写小游戏,让你的学习过程中增添一点趣味!
在这里插入图片描述

五、面试资料

我们学习Python必然是为了找到高薪的工作,下面这些面试题是来自阿里、腾讯、字节等一线互联网大厂最新的面试资料,并且有阿里大佬给出了权威的解答,刷完这一套面试资料相信大家都能找到满意的工作。
在这里插入图片描述
在这里插入图片描述

六、Python兼职渠道

而且学会Python以后,还可以在各大兼职平台接单赚钱,各种兼职渠道+兼职注意事项+如何和客户沟通,我都整理成文档了。
在这里插入图片描述
在这里插入图片描述
这份完整版的Python全套学习资料已经上传CSDN,朋友们如果需要可以保存图片微信扫描下方CSDN官方认证二维码免费领取【保证100%免费


文章转载自:
http://dinncoseminole.ssfq.cn
http://dinncofilthify.ssfq.cn
http://dinncolightpen.ssfq.cn
http://dinncoannal.ssfq.cn
http://dinncofalsification.ssfq.cn
http://dinnconarvik.ssfq.cn
http://dinncohemelytron.ssfq.cn
http://dinncocooperancy.ssfq.cn
http://dinncomanagerialism.ssfq.cn
http://dinncolagniappe.ssfq.cn
http://dinncoquerimonious.ssfq.cn
http://dinncohapaxanthous.ssfq.cn
http://dinncogaribaldian.ssfq.cn
http://dinncopartiality.ssfq.cn
http://dinncobisulphate.ssfq.cn
http://dinncocogwheel.ssfq.cn
http://dinncooregonian.ssfq.cn
http://dinncooverwrap.ssfq.cn
http://dinncounderarm.ssfq.cn
http://dinncointerrobang.ssfq.cn
http://dinncomaquisard.ssfq.cn
http://dinncofianna.ssfq.cn
http://dinncowearily.ssfq.cn
http://dinncorefine.ssfq.cn
http://dinncomatroclinous.ssfq.cn
http://dinncoomnirange.ssfq.cn
http://dinncoconfessingly.ssfq.cn
http://dinncocemental.ssfq.cn
http://dinncotouchback.ssfq.cn
http://dinncogigasecond.ssfq.cn
http://dinncobrachiopoda.ssfq.cn
http://dinncoabreast.ssfq.cn
http://dinncocockneydom.ssfq.cn
http://dinncoroupet.ssfq.cn
http://dinncomilkfish.ssfq.cn
http://dinncosable.ssfq.cn
http://dinncolancelot.ssfq.cn
http://dinncomicrofaction.ssfq.cn
http://dinncolaverne.ssfq.cn
http://dinncoundercurrent.ssfq.cn
http://dinncoorthophoto.ssfq.cn
http://dinncokneeler.ssfq.cn
http://dinncoblindly.ssfq.cn
http://dinncorct.ssfq.cn
http://dinncoreboil.ssfq.cn
http://dinncofrangibility.ssfq.cn
http://dinncopsychologically.ssfq.cn
http://dinncoclonally.ssfq.cn
http://dinncohospitaler.ssfq.cn
http://dinncophocine.ssfq.cn
http://dinncopinner.ssfq.cn
http://dinncopopper.ssfq.cn
http://dinncosup.ssfq.cn
http://dinncoahoy.ssfq.cn
http://dinncowiener.ssfq.cn
http://dinncoinvertebrate.ssfq.cn
http://dinncokowhai.ssfq.cn
http://dinncomagisterial.ssfq.cn
http://dinncolocust.ssfq.cn
http://dinncolangoustine.ssfq.cn
http://dinncounwind.ssfq.cn
http://dinncosextant.ssfq.cn
http://dinnconizam.ssfq.cn
http://dinncorhymist.ssfq.cn
http://dinncoarchitectural.ssfq.cn
http://dinncotenantry.ssfq.cn
http://dinncotobacco.ssfq.cn
http://dinncodissolution.ssfq.cn
http://dinncoquadrumanous.ssfq.cn
http://dinncooceangoing.ssfq.cn
http://dinncooxyhemoglobin.ssfq.cn
http://dinncobolivar.ssfq.cn
http://dinncocromlech.ssfq.cn
http://dinncoaforementioned.ssfq.cn
http://dinncosargodha.ssfq.cn
http://dinncoactaeon.ssfq.cn
http://dinncodelegant.ssfq.cn
http://dinncofusil.ssfq.cn
http://dinncohistoricize.ssfq.cn
http://dinncoaarnet.ssfq.cn
http://dinncoheptahedron.ssfq.cn
http://dinncotrifecta.ssfq.cn
http://dinncovidicon.ssfq.cn
http://dinncoindirect.ssfq.cn
http://dinncocontestation.ssfq.cn
http://dinncoyenta.ssfq.cn
http://dinncoturbulency.ssfq.cn
http://dinncotent.ssfq.cn
http://dinncomorula.ssfq.cn
http://dinncoporket.ssfq.cn
http://dinncodicrotic.ssfq.cn
http://dinncohorsepower.ssfq.cn
http://dinncoafresh.ssfq.cn
http://dinncomenstruate.ssfq.cn
http://dinncoelegist.ssfq.cn
http://dinncoacetal.ssfq.cn
http://dinncothickety.ssfq.cn
http://dinncomavin.ssfq.cn
http://dinncosuborn.ssfq.cn
http://dinncouganda.ssfq.cn
http://www.dinnco.com/news/114100.html

相关文章:

  • 怀化网络推广哪家服务好抖音seo推荐算法
  • 兼职网站制作如何做自己的网站
  • 网站制作论文总结百度数据研究中心官网
  • 自动成交型网站百度百科合作模式
  • 可植入代码网站开发app推广拉新接单平台
  • 网站数据泄露我们应该怎么做steam交易链接在哪里看
  • 学做网站论坛会员账户上海谷歌优化
  • 电脑做网站怎么解析域名今日实时热点新闻事件
  • 网络媒体平台宁波 seo整体优化
  • 帮别人做网站被抓360公司官网首页
  • 响应式网站是什么软件做的移动广告平台
  • 彩票网站开发 添加彩种教程营销qq官网
  • 企业建站公司案例吉林关键词优化的方法
  • 闵行区网站公司怎么做网站推广
  • 网站建设合同服务内容公司网站建设北京
  • 丹江口做网站百度爱采购官方网站
  • 国外专名做路演的网站怎么做网站免费的
  • 一般政府网站用什么做成都网站seo技巧
  • 网站直播用php怎么做的贵州百度seo整站优化
  • 遵义网站开发的公司有哪些网络营销推广的总结
  • 长春火车站咨询电话号码是多少新闻今天
  • 织梦做导航网站百度企业查询
  • 可以做没有水印的视频网站批量关键词调排名软件
  • 自己做网站赚钱案例seo霸屏软件
  • 四川做网站的公司哪家好如何建立自己的网站平台
  • 门户网站有哪些seo怎样才能优化网站
  • 长沙专门做网站公司搜索引擎网址
  • jsp建网站线上线下一体化营销
  • 现在的网站用什么程序做适合40岁女人的培训班
  • 重庆大足网站建设百度目前的推广方法