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

婚庆公司网站制作宁波网站制作 收费标准

婚庆公司网站制作,宁波网站制作 收费标准,网站建设需要的企业,关键词搜索优化外包分类:字符串 知识点: 获取输入 input().strip().split(" ") 拼接列表 " ".join(list) 输出指定位数的浮点数 print("%.2f" % value) len() 函数对于很多内置的数据类型都适用,它返回对象的元素个数或长度。…

分类:字符串

知识点:

  1. 获取输入 input().strip().split(" ")

  2. 拼接列表 " ".join(list)

  3. 输出指定位数的浮点数 print("%.2f" % value)

  4. len() 函数对于很多内置的数据类型都适用,它返回对象的元素个数或长度。

# 用法1: 获取字符串的长度
string_example = "Hello, World!"
length_of_string = len(string_example)
print("字符串的长度为:", length_of_string)# 用法2: 获取列表或元组的元素个数
list_example = [1, 2, 3, 4, 5]
length_of_list = len(list_example)
print("列表的元素个数为:", length_of_list)# 用法3: 获取字典的键值对个数
dictionary_example = {"a": 1, "b": 2, "c": 3}
length_of_dictionary = len(dictionary_example)
print("字典的键值对个数为:", length_of_dictionary)# 用法4: 获取集合的元素个数
set_example = {1, 2, 3, 4, 5}
length_of_set = len(set_example)
print("集合的元素个数为:", length_of_set)# 用法5: 获取其他可迭代对象的元素个数
tuple_example = (1, 2, 3, 4, 5)
length_of_tuple = len(tuple_example)
print("元组的元素个数为:", length_of_tuple)

题目来自【华为招聘模拟考试】

图片

# If you need to import additional packages or classes, please import here.def func():# please define the python3 input here. For example: a,b = map(int, input().strip().split())words = input().strip().split(" ")# please finish the function body here.total_words = len(words)new_str = "".join(words)total_length = len(new_str)# please define the python3 output here. For example: print().# print(round(total_length/total_words, 2)) # round有bugprint("%.2f" % (total_length/total_words))if __name__ == "__main__":func()

注意,不要使用round,有bug

by: 软件工程小施同学

http://www.yayakq.cn/news/46674/

相关文章:

  • 做响应式网站设计师如何布局呢客户关系管理系统平台
  • 购物网站哪个质量好东莞网络公司哪家好
  • 网站建站程序专业推广公司哪家好
  • 大众点评怎么做团购网站网站开发需要用到哪些技术
  • 湖北建设银行招标在哪个网站看南宁青秀万达网站建设
  • 我有网网站建设福州百度推广开户
  • 企业建站公司哪里找移动网站设计教程
  • 网站代理登录网址沧州市建设局网站
  • 建设银行手机银行网站外国做问卷可以赚钱的网站
  • 建设部网站备案做网站开发最多能做几年
  • python官网seo网站优化知识
  • 口碑好网站建设资源微信在线登录网页版
  • 申请号的网站wordpress seo插件中文
  • 怎么通过淘宝优惠券做网站赚钱满足客户的分销管理系统
  • 如何给网站做推广广州市建设工程招标管理办公室网站
  • 陇西网站建设公司庆安建设局网站
  • WordPress置顶文章优先湖北seo网站设计
  • 网站开发与维护课程设计建筑工程电影网
  • 广东建立网站在线网站建设机构
  • 四川省建设厅燃气网站wordpress金融插件
  • 北京免费网站设计网站合作建设方案
  • ps制作网站模板网站美工
  • 网站建设 中国联盟网中文旅游网站html模板
  • 建设旅游网站目标客户分析站长工具同大全站
  • 可以做3d电影网站有哪些漳州公司建设网站
  • 网站建设与管理行业发展情况微信营销号是啥意思
  • 吴忠网站建设报价企业服务官网模板
  • 做微信公众号页面的网站外贸网站外链
  • 可以做h5网站wordpress 主题 教程
  • 网站建设代理招标武昌做网站报价