#1

  1. print "Welcome to Python!"

#2

  1. my_variable =

#3

  1. # Set the variables to the values listed in the instructions!
  2. my_int =
  3. my_float = 1.23
  4. my_bool = True

#4

  1. # my_int is set to below. What do you think
  2. # will happen if we reset it to and print the result?
  3.  
  4. my_int =
  5.  
  6. # Change the value of my_int to on line !
  7.  
  8. my_int =
  9.  
  10. # Here's some code that will print my_int to the console:
  11. # The print keyword will be covered in detail soon!
  12.  
  13. print my_int

#5

  1. def spam():
  2. eggs =
  3. return eggs
  4. print spam()

#6

  1. def spam():
  2. eggs =
  3. return eggs
  4. print spam()

#7

  1. spam = True
  2. eggs = False

#8

  1. #fuck you
  2. mysterious_variable =

#9

  1. """
  2. """

#10

  1. # Set count_to equal to the sum of two big numbers
  2. count_to = +
  3.  
  4. print count_to

#11

  1. #Set eggs equal to using exponentiation on line !
  2.  
  3. eggs = **
  4.  
  5. print eggs

#12

  1. #Set spam equal to using modulo on line !
  2.  
  3. spam = %
  4.  
  5. print spam

#13

  1. #fuck you
  2. monty = True
  3. python = 1.234
  4. monty_python = python**

#14

  1. # Assign the variable meal the value 44.50 on line !
  2. meal = 44.50

#15

  1. meal = 44.50
  2. tax = 6.75 /

#16

  1. # You're almost there! Assign the tip variable on line 5.
  2.  
  3. meal = 44.50
  4. tax = 0.0675
  5. tip = 15.0 /

#17

  1. # Reassign meal on line !
  2.  
  3. meal = 44.50
  4. tax = 0.0675
  5. tip = 0.15
  6.  
  7. meal = meal + meal*tax

#18

  1. # Assign the variable total on line !
  2.  
  3. meal = 44.50
  4. tax = 0.0675
  5. tip = 0.15
  6.  
  7. meal = meal + meal * tax
  8. total = meal + meal * tip
  9.  
  10. print("%.2f" % total)

#19

  1. # Set the variable brian on line !
  2. brian = "Hello life!"

#20

  1. # Assign your variables below, each on its own line!
  2. caesar = "Graham"
  3. praline = "John"
  4. viking = "Teresa"
  5.  
  6. # Put your variables above this line
  7.  
  8. print caesar
  9. print praline
  10. print viking

#21

  1. # The string below is broken. Fix it using the escape backslash!
  2.  
  3. 'This isn\'t flying, this is falling with style!'

#22

  1. """
  2. The string "PYTHON" has six characters,
  3. numbered to , as shown below:
  4.  
  5. +---+---+---+---+---+---+
  6. | P | Y | T | H | O | N |
  7. +---+---+---+---+---+---+
  8.  
  9. So if you wanted "Y", you could just type
  10. "PYTHON"[] (always start counting from !)
  11. """
  12. fifth_letter = "MONTY"[]
  13.  
  14. print fifth_letter

#23

  1. parrot = "Norwegian Blue"
  2. print len(parrot)

#24

  1. parrot = "Norwegian Blue"
  2. print parrot.lower()

#25

  1. parrot = "norwegian blue"
  2. print parrot.upper()

#26

  1. """Declare and assign your variable on line 4,
  2. then call your method on line !"""
  3. pi=3.14
  4. print str(pi)

#27

  1. ministry = "The Ministry of Silly Walks"
  2.  
  3. print len(ministry)
  4. print ministry.upper()

#28

  1. """Tell Python to print "Monty Python"
  2. to the console on line !"""
  3.  
  4. print "Monty Python"

#29

  1. """Assign the string "Ping!" to
  2. the variable the_machine_goes on
  3. line , then print it out on line !"""
  4. the_machine_goes = "Ping!"
  5. print the_machine_goes

#30

  1. # Print the concatenation of "Spam and eggs" on line !
  2. print "Spam "+"and "+"eggs"

#31

  1. # Turn 3.14 into a string on line !
  2.  
  3. print "The value of pi is around " + str(3.14)

#32

  1. string_1 = "Camelot"
  2. string_2 = "place"
  3.  
  4. print "Let's not go to %s. 'Tis a silly %s." % (string_1, string_2)

#33

  1. name = raw_input("What is your name?")
  2. quest = raw_input("What is your quest?")
  3. color = raw_input("What is your favorite color?")
  4.  
  5. print "Ah, so your name is %s, your quest is %s, " \
  6. "and your favorite color is %s." % (name, quest, color)

#34

  1. # Write your code below, starting on line !
  2. my_string ="haha"
  3. print len(my_string)
  4. print my_string.upper()

#35

Codecademy python的更多相关文章

  1. codecademy练习记录--Learn Python(70%)

    ############################################################################### codecademy python 5. ...

  2. Python 入门【一】Python 初识及学习资料

    Python 初识及学习路线: CodeCademy Python 在线教学: 廖雪峰 Python 2.7 教程: 廖雪峰 Python 3.0 教程: Python 官方文档(2.7~3.7:英文 ...

  3. 2015/8/9 到家了,学完了CodeCademy的Python

    昨天坐了20多个小时的硬座回家.发现在网络信号差的火车上也是学习的好地方.如果你的手机电量不足的话,带上两本书简直是绝配.我在火车上阅读了两百多页的内容,并没有多大的疲累,那样无聊的环境里面能看书学习 ...

  4. Codecademy For Python学习笔记

    一.Python Lists and Dictionaries: 1. 2.

  5. 给大家推荐一个python的学习网站 http://www.codecademy.com

    注册之后,可以跟着指导,自己编码学习,比较方面: 再推荐一个在线编译的代码网站,c/c++ python  都可以: http://codepad.org

  6. 【转】Python资源 转自 dylanninin.com

    http://dylanninin.com/blog/2013/11/23/python_resource.html Python是在工作期间零零碎碎学习起来的.当时正值部门申购图书,鉴于Python ...

  7. Python学习推荐

    1.    Python官网 官网想必是最权威的,不仅有Python 2.X和3.X的软件包,还有官方文档Python tutorial (official docs)及社区. 2.    在线阅读免 ...

  8. Python抓取单个网页中所有的PDF文档

    Github博文地址,此处更新可能不是很及时. 1.背景 最近发现算法以及数据结构落下了不少(其实还是大学没怎么好好学,囧rz),考虑到最近的项目结构越来越复杂了,用它来练练思路,就打算复习下数据结构 ...

  9. 学习Python编程的11个资源

    用 Python 写代码并不难,事实上,它一直以来都是被声称为最容易学习的编程语言.如果你正打算学习 web 开发,Python 是一个不错的选择,甚至你想学游戏开发也可 以从 Python 开始,因 ...

随机推荐

  1. MySQL 执行SQL脚本 报ERROR 1231 (42000)的解决办法【转】

    今天在source mysqldump 备份文件时,发现导入的过程中报如下的错误: ERROR 1231 (42000): Variable 'time_zone' can't be set to t ...

  2. 【hdu6334】【2018Multi-University-Training Contest04】Problem C. Problems on a Tree

    维护1边的联通块和2边的联通块,合并的时候直接启发式合并. cdqz的大爷好强啊. #include<bits/stdc++.h> #define lson (o<<1) #d ...

  3. ifdef等宏的妙用

    条件编译 一般情况下,源程序中所有的行都参加编译.但是有时希望对其中一部分内容只在满足一定条件才进行编译,也就是对一部分内容指定编译的条件,这就是"条件编译". 条件编译命令最常见 ...

  4. java基础60 JavaScript字符串转换成数字(网页知识)

    1.字符串转换成数字 <!doctype html> <html> <head> <meta charset="utf-8"> &l ...

  5. Java 中 日期 时间 加减

    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //方法1(推荐,功能强大灵活多变) Ca ...

  6. Ubuntu 搭建ELK

    一.简介 官网地址:https://www.elastic.co/cn/ 官网权威指南:https://www.elastic.co/guide/cn/elasticsearch/guide/curr ...

  7. 安装部署Apache Hadoop (完全分布式模式并且实现NameNode HA和ResourceManager HA)

    本节内容: 环境规划 配置集群各节点hosts文件 安装JDK1.7 安装依赖包ssh和rsync 各节点时间同步 安装Zookeeper集群 添加Hadoop运行用户 配置主节点登录自己和其他节点不 ...

  8. 【51nod】1564 区间的价值

    题解 这个要注意到一个长度大的区间的最大价值一定比长度小的区间的价值要大 然后我们以每个点为最小值,显然区间越长最大值越大,然后我们更新最大区间长度的取值,这个可以用单调栈求这个最小值能更新到的左右端 ...

  9. Server sent passive reply with unroutable address. Using server address instead

    最近在linux服务器安装vsftp服务.经过一轮设置,终于可以连接上了,用winSCP连接,刷新目录就提示这个错误. 解决办法: vim /etc/vsftpd.conf  ,编辑配置文件,最后加上 ...

  10. 004 Hadoop2.x基础知识

    一:大数据应用 1.Cloudera cloudera公司是Hadoop三大发行商之一,其版本为CDH版本,现在最新的版本是CDH5. 网站:http://archive.cloudera.com/c ...