Girls In AI&ML-Diary1 初识Python

虽然已经学习了一段时间PY了,但是在微博上看到这个话题,准备跟随打卡,那就一起加油吧!

Day1:初识Python

对应Github地址
暑假就已经装上了Anaconda了,一直再用Spyder,还是第一次用Jupyter。
IDE
点击Jupyter Notebook,我的是自动跳转到页面,也可以复制地址进入。
在这里插入图片描述
new->python3->在跳转的网页敲代码->run
在这里插入图片描述
在这里插入图片描述
关闭Jupyter
回到黑色小方框,在框内随便点击一下,再 Ctr+C,按两遍就直接关闭了。

Day2:Python这一大家子

对应github地址
1.查看python版本
平常都用的cmd,又学到了新的
在Jupyter中new->terminal
查看版本
2.下载Python3.5
接下来的课程选用Py3.5。不要用最新版的语言,容易踩坑,Jupyter 和 Python的版本要一致才能顺利运行。

  • 下载python3.5的环境+配置这个环境
    点击Anaconda文件夹下的Anaconda Navigator:
    在这里插入图片描述

  • 创建环境:

  1. 点击左侧菜单栏的“Environment”
  2. 点击下方的“Create”
  3. 在弹出的对话框选择“Python 3.5”在弹出的对话框选择“Python 3.5”
  4. 给这个新环境命名给这个新环境命名
  5. 点击对话框的“Create”,完成Python3.5的下载

创建环境

  • 环境配置
    在这里插入图片描述
  • 下载对应的 Jupyter Notebook
    输入“activate PY35”,启动新环境。这里的“PY35”是我取的新环境名字,你填入你取的名字。
    输入“pip install jupyter notebook”,进行“丘比特?”笔记本下载。在这里插入图片描述
  • 确认Jupyter安装成功
    当新的py3.5版本的Jupyter下载完之后,继续输入命令“jupyter notebook”,就能启动你的新笔记本了:在这里插入图片描述
    新建终端查看版本:
    在这里插入图片描述
#include <iostream> #include <ctime> using namespace std; struct student { int id; char gender; student* next; }; void twoQueue(student* hybrid, student*& girls, student*& boys); void output(student* girls, student* boys); void in(student* h, student* t); student* insert(student* head, student* t); int main() { int num; cin >> num; student* hybrid = NULL, * hybridCur = NULL, * tmp; for (int i = 0; i < num; i++) { tmp = new student; cin >> tmp->id >> tmp->gender; tmp->next = NULL; if (hybridCur == NULL) { hybridCur = tmp; hybrid = hybridCur; } else { hybridCur->next = tmp; hybridCur = hybridCur->next; } } student* girls = NULL, * boys = NULL; twoQueue(hybrid, girls, boys); output(girls, boys); } student* insert(student* head, student* t) { // 请在此添加代码,补全函数insertTail /********** Begin *********/ if (head == NULL) { t->next = NULL; return t; } student* cur = head; while (cur->next != NULL) { cur = cur->next; } cur->next = t; t->next = NULL; return head; /********** End **********/ } void in(student* h, student* t) { if (h == NULL) { t->next = NULL; h = t; } else { student* cur = h; while (cur->next) { cur = cur->next; } cur->next = t; t->next = NULL; } } void twoQueue(student* hybrid, student*& girls, student*& boys) { /**********Program**********/ student* cur = hybrid; student* pre = hybrid; student* g = girls; student* b = boys; int c = 0; while (cur) { if (cur->gender == 'F') { cur = cur->next; pre->next = NULL; in(girls, pre); c++; } else if (cur->gender == 'M') { cur = cur->next; pre->next = NULL; in(boys, pre); //cout << c << " " << pre->id << endl;// c++; } pre = cur; } /********** End **********/ } void output(student* girls, student* boys) { while (girls && girls->next) { cout << girls->id << ","; girls = girls->next; } if (girls) cout << girls->id << ";"; while (boys && boys->next) { cout << boys->id << ","; boys = boys->next; } if (boys) cout << boys->id << endl; }请帮我检查代码的错误
06-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值