Python Programming This program tries to create a Sapceship class with sinlge attribute -num_lights- and one non-constructor method - show_lights. It then instantiates a Spaceship object and tells it to show its lights. See is you can fix it! Class Spaceship;     def_init_(self, num_lights = 0):         self.num_lights = num_lights     def show_lights():         display_strings = ''         for i in range(num-lights):             display_strings += '*'         print(display_string)   s.Spaceship(5) s.show_lights

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 2RQ
icon
Related questions
Question

Python Programming

This program tries to create a Sapceship class with sinlge attribute -num_lights- and one non-constructor method - show_lights. It then instantiates a Spaceship object and tells it to show its lights. See is you can fix it!

Class Spaceship;

    def_init_(self, num_lights = 0):

        self.num_lights = num_lights

    def show_lights():

        display_strings = ''

        for i in range(num-lights):

            display_strings += '*'

        print(display_string)

 

s.Spaceship(5)

s.show_lights()

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,