Python核心编程2第一章课后练习
1-1
在windows下的安装方法
在网上下载python2.7直接安装到C盘
1)在系统变量中找到path。
2)编辑path值,添加你安装的python路径,C:\Python27。
3)检验python是否安装配置成功,打开cmd,输入python,如果出现以下界面,则说 明你的python安装成功了。

1-2
a.三种方法执行python
1)启动交互式解释器powershell python,每次输入一行python代码
2)运行python的脚本
3)集成开发环境图形界面(IDLE)运行python
b.
1-3
3.执行程序在C:python27 标准库在C:/python27/lib
1-4
print 'hello world!'

1-5
1-5.py
print 'hello world!'
powershell中运行

1-6
1-6.py
name="steve"
age=18
favoritecolor="blue"
interest="coding"
print "my name is %s"%name
print "my age is %d"%age
print "my favorite color is %s"%favoritecolor
print "my interest is %s"%interest

Python核心编程2第一章课后练习的更多相关文章
- python核心编程2第二章课后练习
2-1 变量, print 和字符串格式化运算符.启动交互式解释器.给一些变量赋值(字符串,数值等等)并通过输入变量名显示它们的值.再用 print 语句做同样的事.这二者有何区别? 也尝试着使用字符 ...
- python核心编程第4章课后题答案(第二版75页)
4-1Python objects All Python objects have three attributes:type,ID,and value. All are readonly with ...
- python 核心编程第六章课后题自己做的答案
6–6. 字符串.创建一个 string.strip()的替代函数:接受一个字符串,去掉它前面和后面的 空格(如果使用 string.*strip()函数那本练习就没有意义了) 'Take a str ...
- python核心编程第5章课后题答案
5-8Geometry import math def sqcube(): s = float(raw_input('enter length of one side: ')) print 'the ...
- python核心编程第3章课后题答案(第二版55页)
3-4Statements Ues ; 3-5Statements Use\(unless part of a comma-separated sequence in which case \ is ...
- python核心编程第2章课后题答案(第二版36页)
2-5 Loops and Numbers a) i = 0 while i <11: print i i += 1 b) for i in range(0,11): pri ...
- 【7】python核心编程 第十一章-函数和函数式编程
1.*函数(与方法)装饰器 装饰器背后的主要动机源自python 面向对象编程.装饰器是在函数调用之上的修饰.这些修饰 仅是当声明一个函数或者方法的时候,才会应用的额外调用. 装饰器的语法以@开头,接 ...
- Python核心编程笔记 第二章
2.1 程序输出:print语句 可以使用print语句显示变量的字符串表示,或者仅用变量名查看该变量的原始值. 2.2 程序输出和raw_input()内建函数 ...
- [Python核心编程] 第1章 欢迎来到Python世界
什么是Python Python的起源 Python的特点 下载Python 安装Python 运行Python Python文档 比较Python 其他实现 1.什么是Python ...
随机推荐
- UILabel,文字添加下划线,中划线
//显示下划线 //中划线 // NSDictionary *attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber nu ...
- dubbo 运行过程
Overview Architecture Provider: 暴露服务的服务提供方. Consumer: 调用远程服务的服务消费方. Registry: 服务注册与发现的注册中心. Monitor: ...
- ecshop获取客户端操作系统
<?php /** * 获得客户端的操作系统 * * @access private * @return void */ function get_os() { if (empty($_SERV ...
- winform 解决界面闪动、提升加载速度 分类: WinForm 2015-02-03 16:34 161人阅读 评论(0) 收藏
说明: 从一个技术交流群里获得,经验证效果不错. //作用 加快界面加载 protected override CreateParams CreateParams { ...
- C# 数组排序 基本算法 分类: C# 2014-09-25 15:43 129人阅读 评论(0) 收藏
说明:冒泡.直接插入.选择.自带方法四中基本排序算法. using System; using System.Collections.Generic; using System.ComponentMo ...
- 回收InnoDB表空间
以下论述均假定innodb_file_per_table开启 先用常规optimize回收: mysql> select count(*) from t; +----------+ | coun ...
- Java——(六)Collection之Queue集合
------Java培训.Android培训.iOS培训..Net培训.期待与您交流! ------- Queue集合 Queue集合用于模拟队列这种数据结构,队列通常是指“先进先出‘(FIFO)的容 ...
- MAC 环境下 初始化新的mysql root 密码
mac 环境下初始化mysql的root密码 关掉mysql服务,打开系统设置最后的mysql,然后将mysql先关掉 生成一个文件命名mysql-init,文件中放入:一句话,这句话不同版本不一样, ...
- padding and margin.
padding is the space between the content and the border, whereas margin is the space outside the bor ...
- 数据库连接报错之IO异常(The Network Adapter could not establish the connection)
Io 异常: The Network Adapter could not establish the connection 有以下四个原因: 1.oracle配置 listener.ora 和tnsn ...