python电梯题_Python电梯仿真问题

我有一个家庭作业,真让我头疼。它涉及到一个电梯模拟,它接受用户输入的楼层数和使用电梯的人数。人们的起始楼层和目的楼层是楼层内的随机数字。在

我意识到我的代码非常稀疏,而且还有很多空白,但我真的不知道从这里该怎么办。在

我需要building类中的帮助,例如如何使run()和output()部分正常工作。任何其他的建议都将不胜感激和帮助。请注意,我不是在找人帮我做代码,而是握着我的手告诉我该走哪条路。上课对我来说似乎完全是个谜。在import random

floors=raw_input('Please enter the number of floors for the simulation:')

while floors.isalpha() or floors.isspace() or int(floors) <=0:

floors=raw_input('Please re enter a digit for number of floors:')

customers=raw_input('Please enter the number of customers in the building:')

while customers.isalpha() or customers.isspace() or int(customers) <0:

customers=raw_input('Please re enter a digit for number of customers:')

count = 1

class building:

def num_of_floors():

num_of_floors = floors

def custom

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值