Code Combat学习心得(Kithgard地牢45关Mightier Than the Sword)

代码来自(Kithgard地牢45关Mightier Than the Sword)

 

# A variable is a way of holding on to a value.

#变量是一种保存值的方式。

# Here the "password" variable holds the secret phrase we need.#这里“password”变量保存我们需要的密码。

#定义密码为'Secret Message'

password = 'Secret Message'
hero.moveUp()
hero.moveRight()
hero.say(password) #说出变量“password”中包涵的值'Secret Message'


# A variable changes its value whenever you assign it.

#每当您给变量赋予新的值时,变量都会换为新的值。

#给变量”password“赋予新的值“'So Many Doors'
password = 'So Many Doors'
hero.moveRight()
# Change the string in this line to the password variable.

# 在“说“变量时候不要加引号,直接输入变量名称。此处说的密码就是新的值So Many Doors”
hero.say(password)
hero.moveRight()


password = 'Let Me Out Of Here'
# Move to the last door and say the password variable to open it.

#移动到最后一扇门并说出新密码变量'Let Me Out Of Here'以打开它。
hero.say(password)

 

转载于:https://www.cnblogs.com/hzez/p/8504273.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值