PYTHON exam Questions and Answers 100% Pass
PYTHON exam Questions and Answers 100% Pass The following code represents a ________________ if structure. if a >= 1: if a == 1: - Correct Answer️️ -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 - Correct Answer️️ -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. - Correct Answer️️ -print(message + percentage + letter_grade) Given the following parallel lists, which piece of code will print out each student and their major?LearnSafe PDF students = ["Jimmy", "Ravi", "Lauren"] majors = ["Accounting", "Finance", "ISA"] - Correct Answer️️ -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") - Correct Answer️️ -not approved The while keyword takes a condition just like which other keyword? - Correct Answer️️ -if Which of the following is a valid variable name in Python?: 1st place None of these answers 1st_place and - Correct Answer️️ -None of these answers What is printed by the following program?LearnSafe PDF 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) - Correct Answer️️ -15 A _____________ is Boolean variable often used to control
Written for
- Institution
- Python Programming
- Course
- Python Programming
Document information
- Uploaded on
- June 17, 2024
- Number of pages
- 15
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
python exam questions and answers 100 pass
Also available in package deal