nodejs self quit program 1

nodejs self quit program

process.exit()

Here is what the above code is Doing:
1. We’re importing the sys module, which gives us access to the exit() function.
2. We’re importing the random module, which gives us access to the randint() function.
3. We’re creating a list of possible answers.
4. We’re creating a variable called answer, which is a random item from the list of possible answers.
5. We’re creating a variable called question, which is set to the first command line argument.
6. We’re printing the question and answer to the screen.
7. We’re exiting the program.

Similar Posts