Python Exam Questions and Answers 100% Pass
Python Exam Questions and Answers 100% Pass What is printed by the following program? my_total = 0 do_not_stop = True while do_not_stop == True: my_total += 5 if my_total > 10: do_not_stop = False print(my_total) 0 Nothing, the program does not stop running. It contains an infinite loop. 10 15 - Correct Answer️️ -15 The index of the first element in a Python list is ____________. 2 There is insufficient information to answer the question. 1 0 - Correct Answer️️ -0 The while keyword takes a condition just like which other keyword? elseLearnSafe PDF if None of these answers input - Correct Answer️️ -if The following program is intended to display True Love. The program contains an error. Which answer best describes the problem with the program? a = True b = "Love" print(a + " " + b) A string cannot be concatenated with a Boolean Love should not have quotes Variable b was not defined as a string before being assigned a value You cannot perform addition with strings - Correct Answer️️ -A string cannot be concatenated with a Boolean The following code represents a ________________ if structure. if a >= 1: if a == 1: sequential redundant parallel nested - Correct Answer️️ -nested What will be displayed by the following code? age = 18 score = 550LearnSafe PDF income = 60000 if age >= 20 or (score > 600 and income > 50000): print("approved") elif age > 18 and age < 20: print("approved with condition")else: print("not approv
Escuela, estudio y materia
- Institución
- Python Programming
- Grado
- Python Programming
Información del documento
- Subido en
- 17 de junio de 2024
- Número de páginas
- 7
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas
Temas
-
python exam questions and answers 100 pass
Documento también disponible en un lote