PYTHON exam 2023 with 100% correct answers
The following code represents a ________________ if structure. if a = 1: if a == 1: nested Which line of code sets the value of the variable take_home to 500? take_home == 1500 / (1 + 2) take_home = 250 * 6 / 1 + 2 take_home = 250 * (5 % 3) take_home = 250 * 5 - 3 take_home = 250 * (5 % 3) Given the code message = "Your percentage score of " percentage = "95.6" letter_grade = "% is an A grade." What is the correct code to display the following result? Your percentage score of 95.6% is an A grade. print(message + percentage + letter_grade) Given the following parallel lists, which piece of code will print out each student and their major? students = ["Jimmy", "Ravi", "Lauren"] majors = ["Accounting", "Finance", "ISA"] for i,student in enumerate(students): print(student + ", Major: " + majors[i]) What will be displayed by the following code? age = 18 score = 550 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 approved") not approved
Información del documento
- Subido en
- 28 de julio de 2023
- Número de páginas
- 13
- Escrito en
- 2022/2023
- Tipo
- Examen
- Contiene
- Preguntas y respuestas