Learn Python the Hard Way 7: Ex05 More Variables and Printing
来源:互联网 发布:淘宝众划算怎么样 编辑:程序博客网 时间:2024/06/02 00:36
7 Ex05 More Variables and Printing
7.1 格式化输出字符串
# -*- coding: utf-8 -*my_name = 'Zed A. Shaw'my_age = 35 # not a liemy_height = 74 # inchesmy_weight = 180 # lbsmy_eyes = 'Blue'my_teech = 'White'my_hair = 'Brown'print "Let'talk about %s." %my_name #注意没有逗号print "He's %d inches tall." %my_heightprint "Actually that's not too heavy."print "He's got %s eyes and %s hair." %(my_eyes, my_hair)print "His teeth are usually %s depending on the coffee." %my_teech# this line is tricky, try to get it exactly rightprint "If I add %d, %d, and %d I get %d." %(my_age, my_height, my_weight, my_age + my_height + my_weight)
这是你应该得到的输出:
0 0
- Learn Python the Hard Way 7: Ex05 More Variables and Printing
- Learn Python the Hard Way 9: Ex07 More Printing
- Learn Python the Hard Way 6: Ex04 Variables and Names
- Learn Python The Hard Way
- Learn Python The Hard Way
- Learn Python the Hard Way 5: Ex03 Numbers and Math
- Learn Python the Hard Way 8: Ex06 Strings and Text
- Learn Python The Hard Way学习(7) - 更多的打印
- Learn Python the Hard Way ex48
- 学《learn python the hard way》(3)
- learn python the hard way 的ex48
- Learn Python The Hard Way-Ecercise1~5
- Learn Python The Hard Way-Ecercise6~10
- Learn Python The Hard Way-Ecercise11~15
- Learn Python The Hard Way-Ecercise16~20
- Learn Python The Hard Way-Ecercise21~25
- Learn Python The Hard Way-Ecercise26~30
- Learn Python The Hard Way-Ecercise31~35
- 第一天
- 设计模式的六大设计原则
- 工厂方法模式
- 建造者模式
- 模板方法模式
- Learn Python the Hard Way 7: Ex05 More Variables and Printing
- angular的directive指令的link方法
- ViewPager 源码分析(二) —— 关于 notifyDataSetChanged()
- OPENGL学习笔记(十二)
- Android Studio cmake方式jni开发,在c层使用其它动态链接库*.so
- Cocos2d-x 记录游戏日志并上传
- js变量 命名 交换
- TCP/UDP的区别
- epoll的水平触发和边缘触发