《笨办法学python》加分习题41——我的答案

这是我自己学习的答案,会尽力写的比较好。还望大家能够提出我的不足和错误,谢谢!

原文例题:

from sys import  exit
from  random import randint

def death():
    quips = ["You died. You kiinda suck at this.",
             "Nice job, you died ...jackass.",
             "Such a luser.",
             "I hace a small puppy that's better at this."]
    print quips[randint(0, len(quips)-1)]
    exit(1)


def central_corridor():
    print "The Gothons of Planet Percal #25 have incaded your " \
          "ship and destryed"
    print "your entire crew. You are the last surviving " \
          "member and your last"
    print "mission is to get the neutron destruct bomb from" \
          " the Weapons Aromory,"
    print "put it in the bridge, and blow the ship up after" \
          " getting into an "
    print "Escape pod."
    print "\n"
    print "Yor're running down the central corridor to the" \
          "Weapons Aromry when" \
          "\n" \
          "a Gothon jumps out, red scaly skin, dark grimy" \
          " teeth, and wvil clown costume" \
          "\n" \
          "flowing around his hate filled boby. He's blocking " \
          "the door to the" \
          "\n" \
          "Armory and about to pull a weapon to blast you."

    action = raw_input("> ")

    if action == "shoot!":
        print "Quick on the draw you yank out your blaster and" \
              "fire it at the Gothon." \
              "\n" \
              "His clown costume is flowing and moving around " \
              "his body,which throws" \
              "\n" \
              "off your aim. Your laser hits his costume but " \
              "misses him entirely. This" \
              "\n" \
              "completely ruins his brand new costume his mother" \
              " bought him, which" \
              "\n" \
              "makes him fly into an insane rage and blast you" \
              " repeately in the face until" \
              "\n" \
              "you are dea. Then he eats you."
        return 'death'

    elif action == "dodge!":
        print "Like a world class boxer you dodge, weave, slip" \
              "and slide right" \
              "\n" \
              "as the Gothon's blaster cranks a lase
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值