Python Test 3 - For and While What will be the output of the following Python code? x = ['ab', 'cd'] for i in x: i.upper() print(x) [‘AB’, ‘CD’] [‘ab’, ‘cd’] [None, None] none of the mentioned What will be the output of the following Python code? x = ['ab', 'cd'] for i in x: x.append(i.upper()) print(x) [‘ab’, ‘cd’, ‘AB’, ‘CD’] [‘AB’, ‘CD’] [‘ab’, ‘cd’] none of the mentioned What will be the output of the following Python code? i = 1 while True: if i%3 == 0: break print(i) i + = 1 1 2 3 error 1 2 none of the mentioned What will be the output of the following Python code? i = 1 while True: if i%0O7 == 0: break print(i) i += 1 1 2 3 4 5 6 1 2 3 4 5 6 7 error none of the mentioned What will be the output of the following Python code? i = 5 while True: if i%0O11 == 0: break print(i) i += 1 error 5 6 5 6 7 8 5 6 7 8 9 10 What will be the output of the following Python code? i = 5 while True: if i%0O9 == 0: break print(i) i += 1 5 6 7 8 9 5 6 7 8 5 6 7 8 9 10 11 12 13 14 15 …. error What will be the output of the following Python code? i = 1 while True: if i%2 == 0: break print(i) i += 2 1 3 5 7 9 11 … 1 2 3 4 5 6 … 1 2 1 What will be the output of the following Python code? i = 2 while True: if i%3 == 0: break print(i) i += 2 2 3 2 4 6 8 10 … 2 4 error What will be the output of the following Python code? i = 1 while False: if i%2 == 0: break print(i) i += 2 1 1 2 3 4 … 1 3 5 7 … none of the mentioned What will be the output of the following Python code? True = False while True: print(True) break none of the mentioned None False True Schreibe einen Kommentar Antworten abbrechenDu musst angemeldet sein, um einen Kommentar abzugeben.