Registrations Closing Soon for DevOps Certification Training by CloudxLab | Registrations Closing inEnroll Now
Here, we will create a sample Python script with dead code. We will use
vi to write the script.
vi is used to:
vi has multiple modes: command mode, insert, append mode. In the beginning, it is in command mode. you can type
a to change the mode to append mode. Once in append mode, you can type text content.
We pass the commands such as quit file, delete line, search etc in command mode. If you want to change the mode to command mode, press
To exit from the file, we press
ESC key to go to command mode and type
:wq and hit the
Enter key. In
w means save, and
q means quit.
Create a file named
vi with the following command:
Now enter the following content in the
import os class Greeter: def greet(self): print("Hi") def hello_world(): message = "Hello, world!" greeter = Greeter() greet_func = getattr(greeter, "greet") greet_func() if __name__ == "__main__": hello_world()
No hints are availble for this assesment
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here