当前位置: 首页 > 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/306551/

相关文章:

  • 怎么创造一个网站网站设置默认主页
  • 淘宝做短视频网站自己开发app的软件下载
  • 网站开发设计技术仿购物网站目录
  • 给图像做标注的网站网络运营学校
  • 十堰做网站最好的公司做网站 node php
  • 西安网站优化效果网站开发 托管合同
  • 成都快速建站公司大型网站建设哪家快
  • 泉州网站建设qzdzi烟台H5网站设计公司
  • 白山做网站网站开发强制使用急速内核
  • 网站设计集团wordpress导航插件
  • 永久免费自动建站seo推广营销公司
  • 中国建设网官方网站下载e路最新版官方网站现在用h5做的吗
  • 设计网站建设莱芜深圳做网站排名公司推荐
  • 申请免费网站多少钱河南省建筑工程信息网
  • 柳州最强的网站建设wordpress可视化插件下载
  • 个人网站开发教程网站服务器上线后要怎么做
  • 成都网站建设:昆山网站建设第一品牌
  • 如何购买网站工信部icp备案查询系统
  • 漯河小学网站建设网页传奇打金
  • 驻马店哪家做网站好网站后台怎么添加栏目
  • 在线做GO分析的网站推广平台有哪些适用于广告
  • 通辽网站开发0475seo广州微信网站建设价格
  • 韩雪冬个人网站预付网站建设费会计处理
  • 随州网站制作邯郸网站建设安联网络公司
  • 金华市建设技工学校教育培训网站mvc做网站前台代码
  • 网站建设费计入 科目网站模板为什么不好
  • 做网站交付标准添加网站栏目的步骤
  • 网站关键词密度是怎么计算的东莞建设信息网官网
  • 我自己的网站怎么做关键词优化威海网站建设 孔
  • 黑河网站seoseo整站优化吧