Codecademy python
#1
print "Welcome to Python!"
#2
my_variable =
#3
# Set the variables to the values listed in the instructions!
my_int =
my_float = 1.23
my_bool = True
#4
# my_int is set to below. What do you think
# will happen if we reset it to and print the result? my_int = # Change the value of my_int to on line ! my_int = # Here's some code that will print my_int to the console:
# The print keyword will be covered in detail soon! print my_int
#5
def spam():
eggs =
return eggs
print spam()
#6
def spam():
eggs =
return eggs
print spam()
#7
spam = True
eggs = False
#8
#fuck you
mysterious_variable =
#9
"""
"""
#10
# Set count_to equal to the sum of two big numbers
count_to = + print count_to
#11
#Set eggs equal to using exponentiation on line ! eggs = ** print eggs
#12
#Set spam equal to using modulo on line ! spam = % print spam
#13
#fuck you
monty = True
python = 1.234
monty_python = python**
#14
# Assign the variable meal the value 44.50 on line !
meal = 44.50
#15
meal = 44.50
tax = 6.75 /
#16
# You're almost there! Assign the tip variable on line 5. meal = 44.50
tax = 0.0675
tip = 15.0 /
#17
# Reassign meal on line ! meal = 44.50
tax = 0.0675
tip = 0.15 meal = meal + meal*tax
#18
# Assign the variable total on line ! meal = 44.50
tax = 0.0675
tip = 0.15 meal = meal + meal * tax
total = meal + meal * tip print("%.2f" % total)
#19
# Set the variable brian on line !
brian = "Hello life!"
#20
# Assign your variables below, each on its own line!
caesar = "Graham"
praline = "John"
viking = "Teresa" # Put your variables above this line print caesar
print praline
print viking
#21
# The string below is broken. Fix it using the escape backslash! 'This isn\'t flying, this is falling with style!'
#22
"""
The string "PYTHON" has six characters,
numbered to , as shown below: +---+---+---+---+---+---+
| P | Y | T | H | O | N |
+---+---+---+---+---+---+ So if you wanted "Y", you could just type
"PYTHON"[] (always start counting from !)
"""
fifth_letter = "MONTY"[] print fifth_letter
#23
parrot = "Norwegian Blue"
print len(parrot)
#24
parrot = "Norwegian Blue"
print parrot.lower()
#25
parrot = "norwegian blue"
print parrot.upper()
#26
"""Declare and assign your variable on line 4,
then call your method on line !"""
pi=3.14
print str(pi)
#27
ministry = "The Ministry of Silly Walks" print len(ministry)
print ministry.upper()
#28
"""Tell Python to print "Monty Python"
to the console on line !""" print "Monty Python"
#29
"""Assign the string "Ping!" to
the variable the_machine_goes on
line , then print it out on line !"""
the_machine_goes = "Ping!"
print the_machine_goes
#30
# Print the concatenation of "Spam and eggs" on line !
print "Spam "+"and "+"eggs"
#31
# Turn 3.14 into a string on line ! print "The value of pi is around " + str(3.14)
#32
string_1 = "Camelot"
string_2 = "place" print "Let's not go to %s. 'Tis a silly %s." % (string_1, string_2)
#33
name = raw_input("What is your name?")
quest = raw_input("What is your quest?")
color = raw_input("What is your favorite color?") print "Ah, so your name is %s, your quest is %s, " \
"and your favorite color is %s." % (name, quest, color)
#34
# Write your code below, starting on line !
my_string ="haha"
print len(my_string)
print my_string.upper()
#35
Codecademy python的更多相关文章
- codecademy练习记录--Learn Python(70%)
############################################################################### codecademy python 5. ...
- Python 入门【一】Python 初识及学习资料
Python 初识及学习路线: CodeCademy Python 在线教学: 廖雪峰 Python 2.7 教程: 廖雪峰 Python 3.0 教程: Python 官方文档(2.7~3.7:英文 ...
- 2015/8/9 到家了,学完了CodeCademy的Python
昨天坐了20多个小时的硬座回家.发现在网络信号差的火车上也是学习的好地方.如果你的手机电量不足的话,带上两本书简直是绝配.我在火车上阅读了两百多页的内容,并没有多大的疲累,那样无聊的环境里面能看书学习 ...
- Codecademy For Python学习笔记
一.Python Lists and Dictionaries: 1. 2.
- 给大家推荐一个python的学习网站 http://www.codecademy.com
注册之后,可以跟着指导,自己编码学习,比较方面: 再推荐一个在线编译的代码网站,c/c++ python 都可以: http://codepad.org
- 【转】Python资源 转自 dylanninin.com
http://dylanninin.com/blog/2013/11/23/python_resource.html Python是在工作期间零零碎碎学习起来的.当时正值部门申购图书,鉴于Python ...
- Python学习推荐
1. Python官网 官网想必是最权威的,不仅有Python 2.X和3.X的软件包,还有官方文档Python tutorial (official docs)及社区. 2. 在线阅读免 ...
- Python抓取单个网页中所有的PDF文档
Github博文地址,此处更新可能不是很及时. 1.背景 最近发现算法以及数据结构落下了不少(其实还是大学没怎么好好学,囧rz),考虑到最近的项目结构越来越复杂了,用它来练练思路,就打算复习下数据结构 ...
- 学习Python编程的11个资源
用 Python 写代码并不难,事实上,它一直以来都是被声称为最容易学习的编程语言.如果你正打算学习 web 开发,Python 是一个不错的选择,甚至你想学游戏开发也可 以从 Python 开始,因 ...
随机推荐
- aarch64_g5
gtkmm24-devel-2.24.5-2.fc26.aarch64.rpm 2017-02-11 18:17 620K fedora Mirroring Project gtkmm24-docs- ...
- python网络编程--事件驱动模型
论事件驱动与异步IO 事件驱动模型:根据事件的触发去干什么事,就是根据一个事件做反应 原文:http://www.cnblogs.com/alex3714/articles/5248247.html常 ...
- python随笔(二)
range(2,10):不包括10 range(2,10,3):步长为3 range(10,2,-1):从10到2,步长-1.
- ubuntu和windows双系统启动顺序的修改
ubuntu和windows双系统启动顺序的修改 说到启动就不得不说GRUB,Linux下大名鼎鼎的启动管理工具(曾经的LILO已经风光不再),当然现在已经是GRUB2了,GRUB2和GRUB最重要的 ...
- 安装部署Apache Hadoop (本地模式和伪分布式)
本节内容: Hadoop版本 安装部署Hadoop 一.Hadoop版本 1. Hadoop版本种类 目前Hadoop发行版非常多,有华为发行版.Intel发行版.Cloudera发行版(CDH)等, ...
- progressDialog和子线程模拟显示拷贝进度
package com.example.wang.myapplication; import android.app.ProgressDialog; import android.os.Bundle; ...
- Web前端开发最佳实践(9):CSS代码太太乱,重复代码太多?你需要精简CSS代码
前言 提高网站整体加载速度的一个重要手段就是提高代码文件的网络传输速度.之前提到过,所有的代码文件都应该是经过压缩了的,这可提高网络传输速度,提高性能.除了压缩代码之外,精简代码也是一种减小代码文件大 ...
- LoadRunner 自带订票系统flights 功能空白、1080端口被占用的解决办法
LoadRunner 自带订票系统flights 功能空白.1080端口被占用的解决办法 安装LoadRunner8.1后运行Mercury Web Tours Application,点击fligh ...
- hdoj2037 今年暑假不AC(贪心)
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=2037 思路 想要看的节目尽可能的多,则首先要将节目按照结束时间从早到晚排序,因为一个节目越早结束,留给 ...
- webstorm for ubuntu install
1. from https://www.tslang.cn/index.html#download-links downloading https://www.jetbrains.com/webst ...