You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// You will need to play computer with this example - use the Python Visualiser https://pythontutor.com/visualize.html#mode=edit
15
16
// to help you answer these questions
16
17
17
18
// Questions
18
19
19
20
// a) When formatTimeDisplay is called how many times will pad be called?
20
-
// =============> write your answer here
21
+
// =============> 3 times
21
22
22
23
// Call formatTimeDisplay with an input of 61, now answer the following:
23
24
24
25
// b) What is the value assigned to num when pad is called for the first time?
25
-
// =============> write your answer here
26
+
// =============> 0
26
27
27
28
// c) What is the return value of pad is called for the first time?
28
-
// =============> write your answer here
29
+
// =============> 00
29
30
30
31
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
31
-
// =============> write your answer here
32
+
// =============> 1. The remainder operator (%) returns the remainder left after dividing one number by another number. 61 % 60
32
33
33
34
// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer
34
-
// =============> write your answer here
35
+
// =============> 01. The padStart() method takes the length of the string as its first value, and the second value is what will fill the beginning of the string if its length is insufficient.
0 commit comments