麻省理工学院公开课:计算机科学及编程导论课件,习题



code fragment, it will be executed. For instance, typing:
and pressing ENTER, will cause the following to be displayed:
IDLE can also be used as a calculator:
Addition, subtraction, multiplication operators are built into the Python language. This means you can use them right away. If you want to use a square root in your calculation you need to import the math module. Do not worry about what it means right now, we will cover this later during the course. Below

is an example of square root calculation:

Math module allows you to do a number of useful operations:
Note that you only need to execute the import command once after you start IDLE.
Exercise
(this is just for practice, solutions will not be graded or collected in class)
Use IDLE to calculate:
1. 23.0 to the 5th power
2. Positive root of the following equation:
34*x^2 + 68*x - 510
Recall:
a*x^2 + b*x + c
x1 = ( - b + sqrt ( b*b - 4*a*c ) ) / ( 2*a)
--------
The tutorial for IDLE is based on the official IDLE tutorial by Daryl Harms.
Getting_Started(1) 62页 1财富值 2_Getting Started 25页 2财富值 Getting_Started(2) 36页 1财富值 Getting_Started_ZH 39页 5财富值 4 Getting Started...
Getting_Started 19页 2财富值 Getting Started 102页 免费 Getting_Started(1) 62页 1财富值 2_Getting Started 25页 2财富值 Getting_Started(2) 36页 1...
Getting_Started Navicat 9.x 中文帮助文档Navicat 9.x 中文帮助文档隐藏>> 目录入门 连接设置 MySQL 常规设置 Oracle 常规设置 Basic 连接常规设置 TNS 连接常规...
Graphical User Interface OLGA 2000 Getting started SCANDPOWER PETROLEUM TECHNOLOGY Kjeller, Norway OLGA 2000 Graphical User Interface – Getting started Page i...
01Getting_started_with_SPSS_英语学习_外语学习_教育专区。Getting started with SPSS Xu Jiajin Beijing Foreign Studies University Key points ? Introducing SP...
Getting_Started_with_DBProxy_互联网_IT/计算机_专业资料。Getting Started with DBProxy 搜狐技术部 - DBA平台组 概述 ? 面临的问题 ? DBProxy介绍 ? DB...
Outline Overview Installing PyQt Hello World in PyQt Widgets Getting Started with PyQt4 David Boddie david@boddie.org.uk 7th February 2009 David Boddie ...
OperaMasks_Studio_Getting_Started_IT/计算机_专业资料。OperaMasks Studio开发入门,很好的入门教程。今日推荐 78份文档 不小心又胖了 胖女人必看...
OperaMasks_Studio_Getting_Started_IT/计算机_专业资料 暂无评价0人阅读0次下载举报文档 OperaMasks_Studio_Getting_Started_IT/计算机_专业资料。OperaMasks 手册...
热门文档