码迷,mamicode.com
首页 >  
搜索关键字:exercise 1-15    ( 479个结果
Exercise 13: Parameters, Unpacking, Variables
from sys import argvscript, first, second, third = argvprint "The script is called:", scriptprint "Your first variable is:", firstprint "Your second v...
分类:其他好文   时间:2014-10-23 14:07:22    阅读次数:150
Exercise 15: Reading Files
from sys import argvscript, filename = argvtxt = open(filename)print "Here's your file %r:" % filename print txt.read()print "Type the filename again:...
分类:其他好文   时间:2014-10-23 14:03:25    阅读次数:129
Exercise 14: Prompting And Passing
from sys import argvscript, user_name = argvprompt = '> 'print "Hi %s, I'm the %s script." % (user_name, script)print "I'd like to ask you a few quest...
分类:其他好文   时间:2014-10-23 13:58:52    阅读次数:170
Exercise 12: Prompting People
age = raw_input("How old are you? ")height = raw_input("How tall are you? ")weight = raw_input("How much do you weigh? ")print "So, you're %r old, %r ...
分类:其他好文   时间:2014-10-23 12:21:22    阅读次数:227
Exercise 1.20 最大公约数算法
The process that a procedure generates is of course dependent on the rules used by the interpreter. As an example, consider the iterative gcd procedur...
分类:编程语言   时间:2014-10-22 20:02:02    阅读次数:283
Exercise 1.19 Fast Fibonacci
题目:There is a clever algorithm for computing the Fibonacci numbers in a logarithmic number of steps.Recall the transformation of the state variables a...
分类:其他好文   时间:2014-10-22 17:46:46    阅读次数:108
Exercise 6: Strings And Text
x = "There are %d types of people." % 10binary = "binary"do_not = "don't"y = "Those who know %s and those who %s." % (binary, do_not)print xprint ypri...
分类:其他好文   时间:2014-10-22 14:22:51    阅读次数:122
Exercise 5: More Variables And Printing
my_name = 'Zed A. Shaw'my_age = 35 # not a liemy_height = 74 # inchesmy_weight = 180 # lbsmy_eyes = 'Blue'my_teeth = 'White'my_hair = 'Brown'print "Le...
分类:其他好文   时间:2014-10-21 23:05:05    阅读次数:257
求2/1+3/2+5/3+8/5+13/8...前20项之和
package com.exercise.coreJava;/** *求2/1+3/2+5/3+8/5+13/8...前20项之和 */public class Sum { public static void main(String[] args) { double sum ...
分类:其他好文   时间:2014-10-21 12:08:49    阅读次数:153
Exercise 2: Comments And Pound Characters
# A comment, this is so you can read your program later.# Anything after the # is ignored by python.print "I could have code like this." # and the com...
分类:其他好文   时间:2014-10-21 10:14:12    阅读次数:137
479条   上一页 1 ... 43 44 45 46 47 48 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!