Answer: The answer is B.
Explanation: Acording to the JS documentation that's the class where you can get that information as well as invoke other methods such as `now()` and `getTime()` on.
Holly wants to add a line of code to a program that will pause the execution of the program. Which module does Holly need to import to do this?
A.
math
B.
numbers
C.
pause
D.
time
Answer:
Explanation:
To pause the execution of a program, Holly needs to import the time module.
The correct option is D. time.
The time module in Python provides functions that allow you to work with time-related operations, including pausing or delaying the execution of a program. By importing the time module, Holly can make use of the time.sleep() function, which can introduce a pause or delay in the program's execution for a specified duration.
Which line of code would allow the user to choose a sword or a shield?
A.
print(“Choose a sword or a shield.”)
B.
weapon = input(“Choose a sword or a shield.”)
C.
sword or shield = (“Choose a sword or a shield.”)
D.
weapon = (“Choose a sword or a shield.”)
Answer:
The correct answer is: B. weapon = input(“Choose a sword or a shield.”)
Explanation:
The line of code "weapon = input("Choose a sword or a shield.")" is the correct choice because it utilizes the input() function to allow the user to enter their choice of a sword or a shield.
Here's a breakdown of why the other options are not correct:
A. print("Choose a sword or a shield.")
This line of code only prints the prompt to choose a sword or a shield but does not allow the user to input their choice.
C. sword or shield = ("Choose a sword or a shield.")
This line of code is not valid syntax. The variable assignment should be on the left side of the equation, but here it is attempting to assign a value to an undefined variable.
D. weapon = ("Choose a sword or a shield.")
This line of code assigns the string "Choose a sword or a shield." to the variable 'weapon' but does not involve user input.
Option B is the correct choice because it uses the input() function to prompt the user for their choice and stores the user's input in the variable 'weapon' for further use in the program.
Answer:
b.
Explanation:
Singh is attending a conference and wants to learn more about computer games that involve asking the user questions so the user can make choices in the game. Which session is the most appropriate?
A.
New Uses for Pseudocode
B.
Nested Loops
C.
Text-Based Adventure Games
D.
Adding Graphics to Multiplayer Games
Answer: c Text-Based Adventure Games
Explanation: