AIC2100代写、Python设计程序代做
Lab 1
Byungjoo Lee
Yonsei University
AIC2100 AI Programming with Python
Lab 1 AIC2100
2
You must follow the specification thorougly!
• Any typos (including whitespace and linebreak) will result in a point deduction.
• If you’re asked to write the comment or docstring, you must add them.
• If some Python libraries are prohibited, importing them will result in 0 points.
• Depending on the lab content, additional rules can be added.
• Please read the specification document carefully and submit your code.
• We won't accept appeals for point deductions based on misinterpreting the lab specification
documentation.
• If any specification is unclear, please post your question on the Q&A board.
Lab 1 AIC2100
3
Please refer to the guidelines noted in previous labs. They remain applicable for this and
subsequent labs.
Any updates in guidelines will be announced again.
Coding guideline
Lab 1 AIC2100
4
Notation
• To clearly instruct the lab specifications, (1) we use “˽” to depict a whitespace (blank)
character and (2) “¤” for a “
” (newline) character.
• Underlined text refers to the user input (will be demonstrated again in a further lab).
• New notations will be demonstrated additionally on there first mention.
Lab 1 AIC2100
5
One important note about automated archiving
• In lab0, the automated archive code used the incorrect folder name format “{student_id}”.
• It should have been “lab{X}_{student_id}”. (Sorry)
• Don’t worry, we did not deduct your point with this since it is our mistake.
• In the slides explaning the automated archive code (ap_lab0.pdf p.15-16), we specified the
wrong format, while in the slide explaning manual archiving (p. 17), we specified the correct
format.
• We revised the code and update it to LearnUs, even though it is outdated.
• TL;DR
• If you want to use automated archiving, just use our provided code. You don’t need to
revise it on your own.
• If you manually archived in Lab 0, “lab{X}_{student_id}” foldername is correct.
Lab 1 AIC2100
6
Problem 1
Write a program that allows the user to enter any integer base and integer exponent, and displays
the value of the base raised to that exponent. Your program should work as shown below.
Note 1. You do not have to consider faulty input. More specifically, we will test your program for
integer inputs only.
Note 2. The integer base and exponent will be non-negative.
This program needs to ask two times for input from the user. The input prompt with the second
input() command depends on the input from the first input() command. This is highlighted in the
following example:
What˽base?˽10¤
What˽power˽of˽10?˽4¤
10˽to˽the˽power˽of˽4˽is˽10000¤
Lab 1 AIC2100
7
Problem 1
Here are some examples.
What˽base?˽0¤
What˽power˽of˽0?˽5¤
0˽to˽the˽power˽of˽5˽is˽0¤
What˽base?˽2¤
What˽power˽of˽2?˽10¤
2˽to˽the˽power˽of˽10˽is˽1024¤
What˽base?˽5¤
What˽power˽of˽5?˽0¤
5˽to˽the˽power˽of˽0˽is˽1¤
What˽base?˽-25¤
What˽power˽of˽-25?˽3.7¤
You don’t need to consider non-integer inputs.
Lab 1 AIC2100
8
Problem 1
FAQ
Q. What is 0
0?
A. Mathematically, it converges to 1 and Python will output 1 too.
Lab 1 AIC2100
9
Problem 2
Write a program that allows the user to enter a base integer and a four-digit number, and displays
its value in base 10. Each digit should be entered one per line, starting with the leftmost digit, as
shown below. This program also needs to ask several times for input from the user. The output
depends on the input from input() command. This is highlighted in the following example:
Enter˽the˽base˽integer:˽2¤
Enter˽leftmost˽digit:˽1¤
Enter˽the˽next˽digit:˽0¤
Enter˽the˽next˽digit:˽0¤
Enter˽the˽last˽digit:˽1¤
Your˽input˽is˽1001˽in˽base˽2¤
The˽value˽is˽9˽in˽base˽10¤
Example 1
Enter˽the˽base˽integer:˽5¤
Enter˽leftmost˽digit:˽0¤
Enter˽the˽next˽digit:˽3¤
Enter˽the˽next˽digit:˽4¤
Enter˽the˽last˽digit:˽2¤
Your˽input˽is˽0342˽in˽base˽5¤
The˽value˽is˽97˽in˽base˽10¤
Example 2
Lab 1 AIC2100
10
Problem 2
Note 1. You can assume that the base integer is integer from 2 to 10 and four-digit numbers are
non-negative integers.
Note 2. You do not have to consider faulty inputs. There are two cases.
- Invalid base integer input (non-integer or out-of-range)
- Invalid four-digit number (non-integer or exceeding base integer)
Note 3. You don’t need to omit starting zeros when printing your input digit numbers (e.g., if your
input is 0011, then print 0011, not 11). See example 2 in the previous slide.
Lab 1 AIC2100
11
Problem 3
Write a program in which the user can enter any number of positive and negative integer values,
that displays the number of positive values entered and their summation, as well as the negative
values. Your program should work in following conditions.
1. Exclude all numbers that aboslute value is greater than 100 (i.e.,
- Ins/Instagram引流新秘籍,ins群发软件一键解锁精准营销!
- COMP S380F代做、SQL语言程序代写
- WhatsApp协议号是什么,自产自销欢迎代发工作室合作
- Instagram官方引流打粉软件,Ins独家爆粉机器人震撼发布!
- 波澜壮阔 我的生意传奇从WhatsApp拉群营销工具的加持开始
- 共话政策扶持与产业创新,东久新宜医疗器械企业闭门会成功举办
- 外贸新秀的秘密武器 WhatsApp拉群工具如何让我的业务成长飞速
- 世贸通美国EB5投资移民美国留学教育:大学择校内幕
- 人工智慧的超脱发展:2024年是否会迎来人工智慧在跨境电商 Telegram 群发云控中超脱发展的契机
- 木秋水·好眼光——繁花爱眼综合解决方案,为眼养护领域给出“东方答案”
- 数据艺术家TG-WS-LINE云控/自动注册机/筛料拉活人:zalo代筛料子专业服务为您呈现一手数据之美
- instagram群发引流必备,高效采集用户,助你实现社交爆粉!
- WhatsApp拉群工具出现我的工作仿佛迎来了翻天覆地的变化
- 神州医疗弓孟春:基于多模态大数据的生成式AI为临床科研提供新质生产力
- Telegram营销软件如何主宰群发筛选引流市场
- Telegram群发工具,轻松引流!营销效果倍增!
- 威尔特(广州)流体设备有限公司企业文化分析
- Xsolla创始人Shurick Agapitov在其充满远见的新书《Once Upon Tomorrow》中探讨了元宇宙对全球创新的影响
- 瑞特科瑞典产品技术团队访华,深化合作共谋发展
- ins群发软件,ins拉群营销软件,联系天宇TG轻松爆粉!
- 专家质疑 WhatsApp拉群营销工具是否真的能在提升业务效果上做到事半功倍
- 数字产品交易平台的革新力量
- 担心推广效果不显著 WhatsApp这个工具一键解决你的烦恼 让你的推广事半功倍
- WhatsApp拉群营销利器 有人发现了吗 分享一下你的独特体验
- 开学前,爱尔英智眼科医院范春雷提醒家长别忘了给孩子查查视力
- 电报一键群发,快速引流!Telegram营销利器助你轻松拉群
- Ins/Instagram自动超级爆粉软件,ins群发采集一键完成!
- Ins/Instagram一键爆粉推广软件,ins群发采集利器强力推荐!
- 星际商海的新星探:2024年是否有跨境电商 Telegram 群发云控冒险者成为星际商海的新星探,勘探新商机
- 网络安全不可或缺:WhatsApp协议号注册器为您的通信保驾护航
推荐
- 苹果罕见大降价,华为的压力给到了? 1、苹果官网罕见大降价冲上热搜。原因是苹 科技
- 老杨第一次再度抓握住一瓶水,他由此产生了新的憧憬 瘫痪十四年后,老杨第一次再度抓握住一瓶水,他 科技
- 升级的脉脉,正在以招聘业务铺开商业化版图 长久以来,求职信息流不对称、单向的信息传递 科技
- 丰田章男称未来依然需要内燃机 已经启动电动机新项目 尽管电动车在全球范围内持续崛起,但丰田章男 科技
- 全力打造中国“创业之都”名片,第十届中国创业者大会将在郑州召开 北京创业科创科技中心主办的第十届中国创业 科技
- 创意驱动增长,Adobe护城河够深吗? Adobe通过其Creative Cloud订阅捆绑包具有 科技
- 智慧驱动 共创未来| 东芝硬盘创新数据存储技术 为期三天的第五届中国(昆明)南亚社会公共安 科技
- B站更新决策机构名单:共有 29 名掌权管理者,包括陈睿、徐逸、李旎、樊欣等人 1 月 15 日消息,据界面新闻,B站上周发布内部 科技
- 疫情期间 这个品牌实现了疯狂扩张 记得第一次喝瑞幸,还是2017年底去北京出差的 科技
- 如何经营一家好企业,需要具备什么要素特点 我们大多数人刚开始创办一家企业都遇到经营 科技