国开大数据分析与挖掘技术形考任务四实验1参考答案

[复制链接]
查看: 39|回复: 0

186

主题

186

帖子

560

积分

高级会员

Rank: 4

积分
560
发表于 2024-5-28 15:06:43 | 显示全部楼层 |阅读模式
.tab-control{
    width:100%!important;
    height:40px!important;
}
.tab-control ul, .tab-control li {
    margin:0!important;
    padding:0!important;
    list-style:none!important;
}
.tab-control ul{
    height:100%;
    width:100%;
    display: inline-block;
}
.tab-control li{
    width:100px;
    height:100%;
    float:left;
    border:none;
    box-sizing:border-box;
    background-color:white;
    cursor: pointer;
    margin-right: 5px !important;
}
.tab-control li:hover{
    border-bottom: 1px solid dodgerblue;
}
.tab-control a{
    display:inline-block;
    width:100%;
    height:100%;
    line-height:100%;
    text-align:center;
    text-decoration: none;
}
.tab-control a::after{
    content:"";
    display:inline-block;
    height:100%;
    vertical-align:middle;
}
.tab-control .selected {
    border-bottom: 1px solid dodgerblue;
}
.docDetail {
    margin-left: 10px;
    display: inline-block;
    vertical-align: top;
    line-height: 40px;
}
.docDetail .comment {
    color: #999;
}
#docContainer .svg_item img {
    width: 100%!important;
}
.viewer-canvas img {
    background-color: #fff;
}
@media (max-width: 767px) {
  .viewer-canvas img {
    /*margin-left: 2px !important;*/
    /*margin-right: 2px !important;*/
    /*width: calc(100% - 4px) !important;  */
  }
}
.viewer-player img {
    background-color: #fff;
}
.viewer-title {
    color: #fff !important;;
}
.viewer-toolbar > ul > li {
    /*transform: scale(1);*/
    height: 30px;
    margin-bottom: -3px;
    margin-top: -3px;
    width: 30px;
}
.viewer-toolbar > ul > li::before {
    margin: 5px;
}
   
        
            
               文档预览
            
            
                文本预览
            
        

      
   
     总页数:约4页   总字数:约1499字
   
        
[img][/img]
[img][/img]
   


  
   实验
  
  
   
    1
   
  

  
   Python 编程基础实验
  


  
   [考核目的]
  


  
   考核学生对下述内容的掌握情况:
  


  
   (
  
  
   1
  
  
   ) python 语言的语法基础
  


  
   (
  
  
   2
  
  
   ) python 的数据类型
  


  
   (
  
  
   3
  
  
   ) 判断/循环/文件读写
  


  
   [
  
  
   考核内容
  
  
   ]
  


  
   (
  
  
   1
  
  
   )准备好一个
  
  
   Jupyter
  
  
   的实验环境
  
  
   ,
  
  
   里面包含一个
  
  
   python2
  
  
   或者
  
  
   python3
  
  
   的内核模块
  


  
   (
  
  
   2
  
  
   )预装好相关的组件库
  


  
   (
  
  
   3
  
  
   )运行参考书中的用例代码;
  


  
   (
  
  
   4
  
  
   )利用 python 工具编写代码
  


  
   [
  
  
   考核要求
  
  
   ]
  


  
   (
  
  
   1
  
  
   )完成课后作业
  


  
   (
  
  
   2
  
  
   )将代码和输出结果以 PDF 报告形式进行提交
  


  
   实验目标
  


  
   (
  
  
   1
  
  
   ) python 语言的语法基础
  


  
   (
  
  
   2
  
  
   ) python 的数据类型
  


  
   (
  
  
   3
  
  
   ) 判断/循环/文件读写
  


  
   实验环境
  


  
   Jupyter
  
  
   的实验环境
  
  
   ,
  
  
   里面包含一个
  
  
   python2
  
  
   或者
  
  
   python3
  
  
   的内核模块
  


  
   验收内容
  


  
   编写示例代码,完成上述目标,掌握基本原理及用法;
  


  
   实验结果
  



  
   
    python
   
  

  
   语言基础
  


  
   代码:
  


  
   str='123456789'
  


  
  


  
   print(str)                 # 输出字符串
  


  
   print(str[0:-1])           # 输出第一个到倒数第二个的所有字符
  


  
   print(str[0])              # 输出字符串第一个字符
  


  
   print(str[2:5])            # 输出从第三个开始到第六个的字符(不包含)
  


  
   print(str[2:])             # 输出从第三个开始后的所有字符
  


  
   print(str[1:5:2])          # 输出从第二个开始到第五个且每隔一个的字符(步长为 2)
  


  
   print(str * 2)             # 输出字符串两次
  


  
   print(str + '你好')         # 连接字符串
  


  
   print('hello\nrunoob')      # 使用反斜杠(\)+n 转义特殊字符
  


  
   print(r'hello\nrunoob')     # 在字符串前面添加一个 r,表示原始字符串,不会发生转义
  


  
   x="a"                       #给变量赋值
  


  
   y="b"
  


  
   print( x )                  # 默认换行输出
  


  
   print( y )
  


  
   print('---------')
  


  
   # 不换行输出
  


  
   print( x, end=" " )
  


  
   print( y, end=" " )
  


  
   运行结果:
  


总页数:4





上一篇:国家开放大学2023年春《临床医学概论(本)-黑龙江》形考任务一二三参考答案
下一篇:国家开放大学2022秋《C语言程序设计》期末上机考试题参考答案
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

精彩课程推荐
|网站地图|网站地图