Python Exam Questions and Answers 100% Pass
Python Exam Questions and Answers 100% Pass Which of the following statements is true about comments in coding? - Correct Answer️️ -Comments are a form of communication with other programmers (including yourself) In the following line of Python code, what is the argument to the input function? user_status = input("How are you today?") - Correct Answer️️ -"How are you today?" Which symbol is used to assign a value to a variable in Python? - Correct Answer️️ -= Which of the following is not a valid variable name in Python? - Correct Answer️️ - my_2_cents In Python, whole numbers like -3, 5 or 11 are stored as variables of type float. - Correct Answer️️ -False Which type of loop is best to use when you know in advance how many times the loop will execute? - Correct Answer️️ -for Given the following code, what is the primary function of the variable i? i=0 while i < 10: print("Go Redhawks!") i += 1 - Correct Answer️️ -loop counter Which of the following is NOT true when interpreting the results of Net Present Value calculations in capital budgeting? - Correct Answer️️ -Projects with a negative NPV should be acceptedPDF DOCUMENT A _____________ is a Boolean variable used in the condition to control whether or not to continue looping. - Correct Answer️️ -flag Statements within the body of a loop execute repeatedly until the condition is: - Correct Answer️️ -false When using the range() function in Python, which argument must always be specified? - Correct Answer️️ -stop The condition(s) of a loop appear directly before the __________________. - Correct Answer️️ -: Which of the following statements are true about a running total? - Correct Answer️️ - its value changes within the body of the loop, it must be part of the loop condition. The body of the loop (the code that executes each time the loop runs) can contain _____________ statements. - Correct Answer️️ -any number of What would be printed by the following loop? i = 20 for x in range(0, 15, 5): i -= x print(i) Correct! - Correct Answer️️ -5 What would be printed by the following code? this_list = ["apple", "banana", "cherry", "orange", "kiwi", "melon", "mango"] print(this_list[2:5]) - Correct Answer️️ -cherry, orange, kiwi
Written for
- Institution
- Python Programming
- Course
- Python Programming
Document information
- Uploaded on
- June 17, 2024
- Number of pages
- 7
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
python exam questions and answers 100 pass
Document also available in package deal