from Bot import bot from SuperBot import SuperBot from FlyingBot import FlyingBot #An object of SuperBot class [this object is superbot1] superbot1 = SuperBot("Dale", 47, 100, 200, 300) #An object of bot class [this object is bot1] bot1 = bot("Ross", 53, 10, 20) #An object of SuperBot class [this object is superbot1] flyingbot1 = FlyingBot("Martin", 60, 250, 35000, 400, 80) #Set of commands to test the workings of my code bot1.display_name() superbot1.display_name() flyingbot1.display_name() bot1.display_age() superbot1.display_age() flyingbot1.display_age() bot1.display_energy() superbot1.display_energy() bot1.display_shield() superbot1.display_shield() bot1.display_summary() superbot1.display_summary() flyingbot1.display_summary() #print(bot1) #print(superbot1) #superbot1.get_super_power_level() #print(super_power_level)
from Bot import Bot from SuperBot import SuperBot from FlyingBot import FlyingBot print("Please enter the bot's name") bots_name = input() print("Please enter the bot's age") bots_age = int(input()) print("Please enter the bot's energy level") bots_energy_level = int(input()) print("Please enter the bots shield level") bots_shield_level = int(input()) New_Bot = Bot(bots_name, bots_age, bots_energy_level, bots_shield_level) New_Super_Bot = SuperBot() New_Flying_Bot = FlyingBot() #Displaying methods New_Bot.display_name() New_Bot.display_age() New_Bot.dispaly_energy() New_Bot.display_shield() New_Bot.display_summary() #Returning methods New_Bot.get_age() New_Bot.get_name() New_Bot.get_energy() New_Bot.get_shield() New_Flying_Bot.get_hover_distane() New_Super_Bot.get_super_power_level()
from Bot import Bot from SuperBot import SuperBot from FlyingBot import FlyingBot bot1 = Bot("Charlie", 10) bot2 = SuperBot("Dave", 50, 100) bot3 = FlyingBot("Bob", 30) bot1.display_summary() bot2.display_age() bot3.get_hover_distance()
from Bot import Bot from SuperBot import SuperBot from FlyingBot import FlyingBot #Creates an object "walle" with parameters of the bot class walle = Bot("Wall-E", 15, 25, 20) superwalle = SuperBot("Super Walle-E", 20, 30, 25, 15) flyingsuperwalle = FlyingBot("Flying Super Walle-E", 25, 35, 30, 20, 5) #Invoked the methods on the bot class walle.display_name() walle.display_age() walle.display_energy() walle.display_shield() superwalle.display_name() superwalle.display_age() superwalle.display_energy() superwalle.display_shield() #invokes the superbot method superwalle.display_super_power_level() flyingsuperwalle.display_name() flyingsuperwalle.display_age() flyingsuperwalle.display_energy() flyingsuperwalle.display_shield() flyingsuperwalle.display_super_power_level() #invokes the flying bot method flyingsuperwalle.display_hover()
def dump_run(): sean = FlyingBot("Sean", 30, 5, 5, 10, 100) sean.display_name() sean.display_age() sean.display_energy() sean.display_shield() sean.display_summary() print(sean)
def run(): sean = FlyingBot("Sean", 30, 5, 5, 10, 100) sean.decrement_energy(2) sean.display_energy()
test = Bot("Botty") test.get_age() test.get_energy() test.get_name() test.get_shield() test.decrement_energy() test.decrement_shield() test.display_name() test.display_age() test.display_energy() test.display_shield_level() test.display_summary() print(test.__str__()) test.increment_age() test.increment_energy() test.increment_shield() test.set_name() super_bot = SuperBot("John") super_bot.get_super_power_level(3000) super_bot.set_super_power_level(3000) flying_bot = FlyingBot("Joe", 30) flying_bot.get_hover_distance() flying_bot.set_hover_distance()