Answer:
b. 2.9!
Explanation:
There are is a mistake in the question.
Suppose the group consist of 10 kids and 2 adults, the number of ways in which they can form the line is:
= 2! 10!
= 2× 1× 10!
= 2.10!
But since that is not in the given option.
Let assume that the group consists of 9 kids and 2 adults, the number of ways in which they can form the line is:
No of ways the kids can be permutated = 9 ways
No of ways the adult can be permutated = two ways.
Thus; the number of ways in which they can form the line = 2! 9!
= 2 × 1× 9!
= 2.9!
def is_list_even(my_list):
for i in my_list:
if(i%2 != 0):
return False
return True
def is_list_odd(my_list):
for i in my_list:
if(i%2 == 0):
return False
return True
def main():
n = int(input())
lst = []
for i in range(n):
lst.append(int(input()))
if(is_list_even(lst)):
print('all even')
elif(is_list_odd(lst)):
print('all odd')
else:
print('not even or odd')
if __name__ == '__main__':
main()
Answer:
import
Explanation:
the <em>import </em>keyword is used to import external modules into a python script.
Answer:
A security utility program that scans the system for small programs that interfere with how a computer functions are _____ utilities.
Explanation:
Answer:
<u>Window.java</u>
- public class Window {
- int width;
- int height;
-
- public Window(int width, int height){
- this.width = width;
- this.height = height;
- }
- public int getWidth(){
- return width;
- }
- public int getHeight(){
- return height;
- }
-
- public int getClientAreaHeight(){
- return getHeight();
- }
- }
<u>Main.java</u>
- public class Main {
- public static void main (String [] args) {
- Window win1 = new Window(12, 15);
- System.out.println(win1.getClientAreaHeight());
- }
- }
Explanation:
<u>Window.java</u>
There is a Window class with two int type attributes, width and height (Line 1 - 3).
The constructor of this class will take two inputs, width and height and set these input to its attributes (Line 5 - 8). There are two methods getWidth and getHeight which will return the value of attributes width and height, respectively (Line 10 - 16).
The required new method getClientAreaHeight is defined in line 18 -20. This method will call the getHeight method to return the height value of the window (Line 19).
<u>Main.java</u>
We test the Window class by creating one Window instance and call the getClientAreaHeight method and print the return output (Line 1 -6).
We shall see 15 is printed.