[PCAP 31-01] Exam5
![]() |
![]() |
![]() |
Título del Test:![]() [PCAP 31-01] Exam5 Descripción: Test para la certificación PCAP 31-03 v5 |




Comentarios |
---|
NO HAY REGISTROS |
The following is a program to validate customer numbers. 1. customer_number = input('Enter the employee number (dd-ddd-dddd): ') 2. parts = customer_number.split('-') 3. valid = False 4. if len(parts) == 3: 5. if len(parts[0]) == 2 and len(parts[1]) == 3 and len(parts[2]) == 4: 6. if parts[0].isdigit() and parts[1].isdigit() and parts[2].isdigit(): 7. valid = True 8. print(valid) The number may only contain numbers and dashes. The number must have the right format (dd-ddd-dddd). What is true about this programm?. There will be a SyntaxError. There will be an AttributeError. The program works properly. There will be no error but there will be an unwanted result. You have the following file. 1. index.py: 2. from sys import argv 3. sum = 0 4. for i in range(2, len(argv)): 5. sum += float(argv[i]) 6. print( 7. "The average score for {0} is {1:.2f}" 8. .format(argv[1], sum/(len(argv)-2)) 9. ) You want the following output. The average score for Peter is 200.00 Which command do you have to execute in the command line?. The code is erroneous. python index.py Peter 100 200. python index.py Peter 100. python index.py Peter 100 200 300. Consider the following code. 1. data = ['Peter', 'Paul', 'Mary', 'Jane'] 2. res = 0 Which of the following code snippets will expand the code, so that 100 will be printed to the monitor? Choose two. 1. for i in ('Peter', 'Steve', 'Jane'): 2. if i not in data: 3. res += 100 4. print(res). 1. for i in ('Peter', 'Steve', 'Jane'): 2. if i not in data: 3. res += 50 4. print(res). 1. for i in ('Peter', 'Steve', 'Jane'): 2. if i in data: 3. res += 100 4. print(res). 1. for i in ('Peter', 'Steve', 'Jane'): 2. if i in data: 3. res += 50 4. print(res). What is the expected output of the following code? 1. def fun(x): 2. assert x >= 0 3. return x ** 0.5 4. 5. 6. def mid_level(x): 7. try: 8. fun(x) 9. except: 10. raise Error 11. 12. 13. try: 14. x = mid_level(-1) 15. except RuntimeError: 16. x = -1 17. except: 18. x = -2 19. print(x). -2. 0. An error message appears on the screen. -1. Given the code below, which of the expressions will evaluate to True? 1. class Alpha: 2. def say(self): 3. return "alpha" 4. 5. 6. class Beta(Alpha): 7. def say(self): 8. return "beta" 9. 10. 11. class Gamma(Alpha): 12. def say(self): 13. return "gamma" 14. 15. 16. class Delta(Beta, Gamma): 17. pass 18. 19. 20. d = Delta() 21. b = Beta() (Select two answers. 1. b is d. 1. d.say() == "gamma". 1. Gamma in Delta.__bases__. 1. isinstance(d, Alpha). You need a list of seven numbers of random integer values from 1 (inclusive) to 7 (inclusive). Which of the following code snippets should you use?. 1. import random 2. nums = random.randint(1, 7). 1. import random 2. nums = [random.randint(1, 7) for i in range(1, 8)]. 1. import random 2. nums = random.randrange(1, 7). 1. import random 2. nums = [random.randint(1, 8) for i in range(1, 8)]. What is the expected output of the following code? 1. x = 1 2. print(++++x). 4. 1. 2. 3. What is the expected output of the following code? 1. consts = (3.141592, 2.718282) 2. try: 3. print(consts[2]) 4. except Exception as exception: 5. print(exception.args) 6. else: 7. print("('success')"). 1. ('success'). 3.141592. ('tuple index out of range',). 2.718282. What is the expected output of the following code? 1. class Package: 2. spam = '' 3. 4. def __init__(self, content): 5. Package.spam += content + ";" 6. 7. 8. envelope_1 = Package("Capacitors") 9. envelope_2 = Package("Transistors") 10. print(envelope_2.spam). It outputs Capacitors;Transistors;. It outputs Transistors;. It outputs Capacitors;. The code is erroneous and it will raise an exception. Which of the following messages will appear on the screen when the code is run? 1. class Accident(Exception): 2. def __init__(self, message): 3. self.message = message 4. 5. def __str__(self): 6. return "problem" 7. 8. 9. try: 10. print("action") 11. raise Accident("accident") 12. except Accident as accident: 13. print(accident) 14. else: 15. print("success") (Select two answers.). 1. success. 1. accident. 1. problem. 1. action. What is the expected output of the following code? 1. def func(data): 2. data = [7, 23, 42] 3. print('Function scope: ', data) 4. 5. 6. data = ['Peter', 'Paul', 'Mary'] 7. func(data) 8. print('Outer scope: ', data). None of the above. 1. Function scope: [7, 23, 42] 2. Outer scope: [7, 23, 42]. 1. Function scope: ['Peter', 'Paul', 'Mary'] 2. Outer scope: ['Peter', 'Paul', 'Mary']. 1. Function scope: [7, 23, 42] 2. Outer scope: ['Peter', 'Paul', 'Mary']. What is the expected output of the following code? 1. def f(l): 2. return l(-3, 3) 3. 4. 5. print(f(lambda x,y: x if x > y else y)). 3. -3. 0. None. Which of the following statements are true? (Select two answers.). The directory from which the Python code is run is always searched through in order to find the necessary modules. The directory from which the code is run is never searched through. Variables with names ending with two underscores are considered private inside their home module. Variables with names starting with two underscores are considered private inside their home module. Which of the following assignments can be performed without raising any exceptions? (Select two answers.). 1. s = 'rhyme' 2. s[0] = s[1]. 1. s = 'rhyme' 2. s = s[::2]. 1. s = 'rhyme' 2. s = s[::-2]. 1. s = 'rhyme' 2. s = s[9]. Which function will you use to reveal a module's contents?. 1. __dir__(). 1. dir(). 1. __dir(). 1. dir__(). The unnamed except block ... can be placed anywhere. cannot be used if any named block has been used. must be the first one. must be the last one. What is the expected output of the following code? 1. x, y, z = 3, 2, 1 2. z, y, x = x, y, z 3. print(x, y, z). 3 2 1. 2 1 3. 1 2 2. 1 2 3. Consider the following Python code: 1. name = 'Peter' 2. age = 23 3. flag = True What are the types of the variables name, age and flag?. str, int, bool. str, int, int. float, bool, str. int, bool, char. What will happen when you attempt to run the following code? 1. print(Hello, World!). The code will raise the ValueError exception. The code will print Hello, World! to the console. The code will raise the AttributeError exception. The code will raise the SyntaxError exception. The code will raise the TypeError exception. The two basic, mutually exclusive, file open modes are named: text and image. binary and ternary. binary and text. What is the expected output of the following code? 1. list1 = [3, 7, 23, 42] 2. list2 = [3, 7, 23, 42] 3. print(list1 is list2) 4. print(list1 == list2). 1. True 2. True. 1. False 2. True. 1. True 2. False. 1. False 2. False. A built-in function is a function which ... has to be imported before use. is hidden from programmers. has been placed within your code by another programmer. comes with Python, and is an integral part of Python. What is the expected output of the following code? 1. nums = [3, 7, 23, 42] 2. alphas = ['p', 'p', 'm', 'j'] 3. 4. print(nums is alphas) 5. print(nums == alphas) 6. 7. nums = alphas 8. 9. print(nums is alphas) 10. print(nums == alphas). 1. False 2. True 3. False 4. True. 1. False 2. False 3. True 4. True. 1. False 2. True 3. True 4. True. 1. True 2. False 3. True 4. False. What is the expected output of the following code? 1. class Ex(Exception): 2. def __init__(self, msg): 3. Exception.__init__(self, msg + msg) 4. self.args = (msg,) 5. 6. 7. try: 8. raise Ex('ex') 9. except Ex as e: 10. print(e) 11. except Exception as e: 12. print(e). exex. ex. The code is erroneous. An empty line. How many arguments can the print() function take?. Just one argument. Any number of arguments (excluding zero). Any number of arguments (including zero). Not more than seven arguments. What is the expected output of the following code? 1. data = {'one': 'two', 'two': 'three', 'three': 'one'} 2. res = data['three'] 3. 4. for _ in range(len(data)): 5. res = data[res] 6. 7. print(res). three. ('one', 'two', 'three'). two. one. What is the expected output of the following code? 1. def func(x, y): 2. if x == y: 3. return x 4. else: 5. return 6. 7. 8. func(x, y=1) 9. print(func(0, 3)). 3. 0. 1. The code is erroneous. What is the expected output of the following code? 1. def func(x): 2. if x % 2 == 0: 3. return 1 4. else: 5. return 6. 7. 8. print(func(func(2)) + 1). 1. None. 2. The code is erroneous. Which of the following enclose the input parameters or arguments of a function?. Parentheses. Brackets. Curly braces. Quotation marks. What is the expected output of the following code? 1. try: 2. print("5" / 0) 3. except ArithmeticError: 4. print("arith") 5. except ZeroDivisionError: 6. print("zero") 7. except: 8. print("some"). zero. some. arith. 0. What is true about the pip search command? Choose three. It needs working internet connection to work. It searches through package names only. It searches through all PyPI packages. All its searches are limited to locally installed packages. What is the expected output of the following code? 1. strng = '\''.join(("Mary", "had", "21", "sheep")) 2. print(strng[0:1].islower()). M. True. Mary. False. What is the expected output of the following code? 1. import random 2. print(random.seed(3)). None. The code is erroneous. None of the above. 3. What is the expected output of the following code? 1. data = (1, 2, 4, 8) 2. data = data[-2:-1] 3. data = data[-1] 4. print(data). 44. (4,). 4. (4). Which of the following expressions evaluates to False and raises no exception?. 10 == '1' + '0'. '9' * 1 <= 1 * 2. '9' * 3 < '9' * 9. 'Al' * 2 <= 'Alan'. If x is a file opened in read mode, what will the following line do? data = x.read(1). Read 1 line from the file. Read 1 buffer from the file. Read 1 kilobyte from the file. Read 1 character from the file. Look at the code below: 1. my_list = [1, 2, 3] 2. # Insert line of code here. 3. print(foo) Which snippet would you insert in order for the program to output the following result (tuple): (1, 4, 27). foo = list(map(lambda x: x*x, my_list)). foo = list(map(lambda x: x**x, my_list)). foo = tuple(map(lambda x: x**x, my_list)). foo = tuple(map(lambda x: x*x, my_list)). Consider the following code. 1. nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 2. x = 0 3. while x < 10: # Line 3 4. print(nums(x)) # Line 4 5. if nums[x] = 7: # Line 5 6. break # Line 6 7. else: # Line 7 8. x += 1 # Line 8 You want to print the numbers 1 to 7 to the monitor. But the code does not work. What do you have to change? Choose two. x = x + 1 # Line 8. print(nums[x]) # Line 4. if nums[x] == 7: # Line 5. while (x < 10): # Line 3. The following line of code ... for line in open('data.txt', 'r'): is invalid as open returns nothing. is invalid as open returns a non-iterable object. is valid as open returns an iterable object. may be valid if line is a list. A is a subclass of B You want to invoke the __init__() method in B from A Which of the following statements do you choose? Choose two. B.__init__(self). B.__init__(). super().__init__(self). super().__init__(). What is the expected output of the following code? 1. try: 2. raise Exception 3. except BaseException: 4. print('1', end='') 5. else: 6. print('2', end='') 7. finally: 8. print('3', end=''). 13. 1. 23. 12. What is the expected output of the following code? marks = [80, 70, 90, 90, 80, 100] average = sum(marks) // len(marks) grade = '' 1. if 90 <= average <= 100: 2. grade = 'A' 3. elif 80 <= average < 90: 4. grade = 'B' 5. elif 70 <= average < 80: 6. grade = 'C' 7. elif 65 <= average < 70: 8. grade = 'D' 9. else: 10. grade = 'F' 11. 12. print(grade). B. A. The code is erroneous. C. D. F. What is the expected output of the following code? 1. data = ((1, 2),) * 7 2. print(len(data[3:8])). 6. 5. 4. The code is erroneous. What is the expected output of the following code? 1. import random 2. 3. random.seed(0) 4. x = random.choice([1, 2]) 5. random.seed(0) 6. y = random.choice([1, 2]) 7. print(x - y). -1. True. 0. 1. Which of the following snippets output True to the screen? (Select two answers.). 1. class A: 2. def __init__(self, value=True): 3. print(value) 4. 5. 6. a = A(). 1. class A: 2. def __init__(): 3. print(True) 4. 5. 6. a = A(). 1. class A: 2. def __init__(self, value=True): 3. print(value) 4. 5. 6. class B(A): 7. def __init__(self, value=False): 8. super().__init__(value) 9. 10. 11. b = B(). 1. class A: 2. def __init__(self): 3. print(True) 4. 5. 6. class B(A): 7. pass 8. 9. 10. b = B(). What is the expected result of executing the following code? 1. def I(): 2. s = 'abcdef' 3. for c in s[::2]: 4. yield c 5. 6. 7. for x in I(): 8. print(x, end=''). It will print abcdef. It will print an empty line. It will print ace. It will print bdf. You want to be able to read and write data to a file. The file needs to be automatically created, if it doesn't exist. If the file does already exist, you want to override the existing content. Which of the following commands do you have to choose?. open('data.txt', 'r+'). open('data.txt', 'w+'). open('data.txt', 'r'). open('data.txt', 'w'). You have the following file. 1. index.py: 2. from sys import argv 3. print(argv[1] + argv[2]) You run the file by executing the following command in the terminal. python index.py 42 3 What is the expected oputput?. 126. The code is erroneous. 423. 45. 424242. What is the expected output of the following code? print(2 ** 3 ** 2 ** 1). 512. 16. 128.0. The code is erroneous. 16.0. 64. If the class constructor is declared in the following way: 1. class Class: 2. def __init__(self, val=0): 3. pass Which one of the assignments is invalid?. object = Class(). object = Class(None). object = Class(1, 2). object = Class(1). What is the expected output of the following code? 1. def func(): 2. try: 3. return 1 4. finally: 5. return 2 6. 7. 8. res = func() 9. print(res). None of the above. 1. 2. The code is erroneous. What code would you insert instead of the comment to obtain the expected output? Expected output: 1. a 2. b 3. c Code: 1. dictionary = {} 2. my_list = ['a', 'b', 'c', 'd'] 3. 4. for i in range(len(my_list) - 1): 5. dictionary[my_list[i]] = (my_list[i], ) 6. 7. for i in sorted(dictionary.keys()): 8. k = dictionary[i] 9. # Insert your code here. print(k["0"]). print(k). print(k[0]). print(k['0']). Select the true statements. Choose two. The finally branch of the try statement may be executed if special conditions are met. The args property is a tuple designed to gather all arguments passed to the exception constructor. The finally branch of the try statement is always executed. You cannot define new exceptions as subclasses derived from predefined exceptions. What will be the result of executing the following code? 1. class A: 2. def a(self): 3. print('a') 4. 5. class B: 6. def a(self): 7. print('b') 8. 9. class C(B, A): 10. def c(self): 11. self.a() 12. 13. o = C() 14. o.c(). It will print b. It will print a. It will raise an exception. It will print c. You create a function to calculate the power of a number by using Python. You need to ensure that the function is documented with comments You create the following code. Line numbers are included for reference only. 1. 01 # The calc_power function calculates exponents 2. 02 # x is the base 3. 03 # y is the exponent 4. 04 # The value of x raised to the y power is returned 5. 05 def calc_power(x, y): 6. 06 comment = "# Return the value" 7. 07 return x ** y # raise x to the y power Which of the following statements are true? Choose two. The pond sign (#) is optional for lines 02 and 03. Line 07 contains an inline comment. Lines 01 through 04 will be ignored for syntax checking. The string in Line 06 will be interpreted as a comment. What is the expected output of the following code if the user enters 2 and 4? 1. x = int(input()) 2. y = int(input()) 3. print(x + y). 6. 4. 2. 24. What is the expected output of the following code? 1. def func(): 2. text = 'Paul' 3. names = lambda x: text + ' ' + x 4. return names 5. 6. 7. people = func() 8. 9. print(people('Peter')). Peter. Peter Paul. Paul. Paul Peter. The code is erroneous. When you use pip to install a package that requires one or more dependencies, then: The package will install all the dependencies during its first run. pip will take care of everything by itsel. You'll have to install all the dependencies by yourself before you install the desired package. You'll have to install all the dependencies by yourself after you install the desired package. Given the code below, indicate the code lines which correctly invokes the __action() method. 1. class BluePrint: 2. __element = 1 3. 4. def __init__(self): 5. self.component = 1 6. 7. def __action(self): 8. pass 9. 10. 11. product = BluePrint(). product.__action(). product._product__action(). BluePrint._BluePrint__action(). product._BluePrint__action(). What is the expected output of the following code? 1. data = {'name': 'Peter', 'age': 30} 2. person = data.copy() 3. print(id(data) == id(person)). False. 1. True. 0. Which of the following commands can be used to read the next line from a file?. readline(). read(). read(n). readlines(). What is the expected output of the following code? 1. def inc(inc): 2. 3. def do(val): 4. return val + inc 5. 6. return do 7. 8. 9. action = inc(-1) 10. print(action(2)). 2. 0. 1. 3. You want to print the sum of two number. What snippet would you insert in the line indicated below: 1. x = input('Enter the first number: ') 2. y = input('Enter the second number: ') 3. # insert your code here. print('The Result is ' + (int(x) + int(y))). print('The Result is ' + (int(x + y))). print('The Result is ' + str(int(x + y))). print('The Result is ' + str(int(x) + int(y))). During the first import of a module, Python deploys the pyc files in the directory called: hashbang. __init__. mymodules. __pycache__. What is the data type of x, y, z after executing the following snippet? x = 23 + 42 y = '23' + '42' z = '23' * 7. int, int, int. int, str, int. int, str, str. x is int, y and z are invalid declarations. What is the expected output of the following code? 1. data1 = '1', '2' 2. data2 = ('3', '4') 3. print(data1 + data2). (1, 2, 3, 4). ('1', '2', '3', '4'). The code is erroneous. ['1', '2', '3', '4']. What is the output of the following snippet? my_list = [x * x for x in range(5)] def fun(lst): del lst[lst[2]] return lst print(fun(my_list)). [0, 1, 9, 16]. [0, 1, 4, 9]. [1, 4, 9, 16]. [0, 1, 4, 16]. A predefined Python variable that stores the current module name is called: __module__. __mod__. __modname__. __name__. What is the expected output of the following code? def func(x=2, y=3): return x * y print(func(y=2)). 4. 2. 6. The code is erroneous. What is the expected output of the following code? x = '\\\' print(len(x)). 3. The code is erroneous. 1. 2. What would you insert instead of ??? so that the program prints True to the monitor? x = 'Peter' y = 'Peter' res = ??? print(res). x is y. x < y. x is not y. x != y. Which of the following sentences is true?str1 = 'Peter' str1 = 'Peter' str2 = str1[:]. str2 is longer than str1. str1 and str2 are different names of the same string. str1 and str2 are different (but equal) strings. str1 is longer than str2. What is the expected output of the following code? data = {'Peter': 30, 'Paul': 31} print(list(data.keys())). ['Peter': 30, 'Paul': 31]. ('Peter', 'Paul'). ['Peter', 'Paul']. ('Peter': 30, 'Paul': 31). You are developing a Python application for an online product distribution company. You need the program to iterate through a list of products and escape when a target product ID is found. 1. productIdList = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] 2. index = 0 3. 4. ??? index < 10: 5. print(productIdList[index]) 6. if productIdList[index] == 6: 7. ??? 8. else: 9. index += 1 What would you insert instead of ??? and ???. for while. if break. while break. while for. for break. break while. Which of the following lines contain valid Python code? (Select two answers.). lambda x: x + 1. lambda x = x + 1. lambda(x): return x + 1. lambda x: None. What is the expected output of the following code? x = 2 y = 6 x += 2 ** 3 x //= y // 2 // 3 print(x). 11. 0. 10. 9. Which of the following functions can be used to check if a file exists?. os.path.exists(). os.path.isFile(). os.path.isfile(). os.isFile(). What is the expected output of the following code? class A: def __init__(self): self.x = 1 def func(self): self.x = 10 class B(A): def func(self): self.x += 1 return self.x b = B() print(b.func()). 2. 10. The code is erroneous. 1. What is the expected output of the following code? 1. x = 42 2. 3. def func(): 4. global x 5. print('1. x:', x) 6. x = 23 7. print('2. x:', x) 8. 9. 10. func() 11. print('3. x:', x). 1. 1. x: 42 2. 2. x: 23 3. 3. x: 42. 1. 1. x: 42 2. 2. x: 23 3. 3. x: 23. 1. 1. x: 42 2. 2. x: 42 3. 3. x: 42. None of the above. What is the expected output of the following code? 1. def func(n): 2. s = '' 3. for i in range(n): 4. s += '*' 5. yield s 6. 7. 8. for x in func(3): 9. print(x, end=''). ******. The code is erroneous. ***. *. What is the expected output of the following code? 1. class A: 2. x = 23 3. 4. 5. class B(A): 6. x = 42 7. 8. 9. class C(B): 10. pass 11. 12. 13. obj = C() 14. print(obj.x). None. 42. The code is erroneous. 23. What is the expected output of the following code? 1. data = [1, 2, 3, None, (), [], ] 2. print(len(data)). 6. 5. 3. 4. What is the expected output of the following code? 1. class A: 2. 3. x = 0 4. 5. def __init__(self, v=0): 6. self.y = v 7. A.x += v 8. 9. 10. a = A() 11. b = A(1) 12. c = A(2) 13. 14. print(c.x). 1. 2. The code is erroneous. 3. 0. You are coding a math utility by using Python. You are writing a function to compute roots. The function must meet the following requirements: If a is non-negative, return a ** (1 / b) If a is negative and even, return 'Result is an imaginary number' If a is negaitve and odd, return -(-a) ** (1 / b) Which of the following functions meets the requirements?. 1. def safe_root(a, b): 2. if a % 2 == 0: 3. answer = a ** (1 / b) 4. elif a >= 0: 5. answer = 'Result is an imaginary number' 6. else: 7. answer = -(-a) ** (1 / b) 8. return answer. 1. def safe_root(a, b): 2. if a >= 0: 3. answer = -(-a) ** (1 / b) 4. elif a % 2 == 0: 5. answer = 'Result is an imaginary number' 6. else: 7. answer = a ** (1 / b) 8. return answer. 1. def safe_root(a, b): 2. if a >= 0: 3. answer = a ** (1 / b) 4. elif a % 2 == 0: 5. answer = 'Result is an imaginary number' 6. else: 7. answer = -(-a) ** (1 / b) 8. return answer. 1. def safe_root(a, b): 2. if a % 2 == 0: 3. answer = -(-a) ** (1 / b) 4. elif a >= 0: 5. answer = 'Result is an imaginary number' 6. else: 7. answer = a ** (1 / b) 8. return answer. The built-in class property called __bases__ is: a dictionary, which contains information about all the superclasses of the class. a variable of type int, which stores the radix currently used by the class. a string, which contains information about the direct superclasses of the class. a tuple, which contains information about the direct superclasses of the class. What is the output of the following code? 1. try: 2. value = input("Enter a value: ") 3. print(value/value) 4. except ValueError: 5. print("Bad input...") 6. except ZeroDivisionError: 7. print("Very bad input...") 8. except TypeError: 9. print("Very very bad input...") 10. except: 11. print("Booo!"). Very bad input... Booo!. Bad input... Very very bad input... ASCII is: a predefined Python variable name. short for American Standard Code for Information Interchange. a character name. a standard Python module name. You want to write a programm that asks the user for a value. For the rest of the programm you need a whole number, even if the user enters a decimal value. What would you have to write?. num = int('How many do you need?'). num = int(float(input('How many do you need?'))). num = str(input('How many do you need?')). num = float(input('How many do you need?')). A data structure described as LIFO is actually a: list. stack. heap. tree. A function able to check if an object is equipped with a given property is named: hasprop(). hasvar(). hasattr(). What is the expected output of the following code? print(3 * 'abc' + 'xyz'). abcxyzabcxyzabcxyz. 3abcxyz. abcabcxyzxyz. abcabcabcxyz. What is the expected output of the following code? 1. data = [1, 2, [3, 4], [5, 6], 7, [8, 9]] 2. count = 0 3. 4. for i in range(len(data)): 5. if type(data[i]) == list: 6. count += 1 7. 8. print(count). 9. 6. 3. The code is erroneous. Given the class hierarchy presented below, indicate which of the following class declarations are impermissible? 1. class Diamond: 2. pass 3. 4. 5. class Adamant(Diamond): 6. pass: 7. 8. 9. class Gem(Diamond): 10. pass (Select two answers): 1. class Jewel(Adamant, Diamond): 2. pass. 1. class Jewel(Diamond, Adamant): 2. pass. 1. class Jewel(Adamant, Gem): 2. pass. 1. class Jewel(Diamond, Gem): 2. pass. How many stars will the following snippet print to the monitor? for i in range(1): print('*') else: print('*'). two. one. three. zero. Consider the following programm to calculate a discount percentage: 1. day = input('Enter the day of the week:') 2. discount = 3 3. 4. if day == 'Wednesday': 5. discount += 5 6. elif day == 'Thursday': 7. discount += 7 8. elif day == 'Saturday': 9. discount += 10 10. elif day == 'Sunday': 11. discount += 20 12. else: 13. discount += 2 Which of the following inputs will get the user a discount of 5 %?. Thursday. Wednesday. Sunday. Friday. Saturday. |