Python Exam Challenge Questions with merged Solution 2024
1. Which of the following is correct about Python? a. Python is a high-level, interpreted, interactive and object-oriented scripting language. b. Python is designed to be highly readable. c. It uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages. d. All of the above - d. All of the above. 2. Is Python case sensitive when dealing with identifiers? a. yes b. no c. it depends on context d. it depends on data type - a. yes 3. Which of the following is an invalid variable? a. my_string b. __a c. 1st_string d. foo_24 - c. 1st_string 4. All keywords in Python are in a. lower case b. UPPER CASE c. Capitalized d. None of the above - d. None of the above 5. ______________(str) is the function to run in the shell to find out details about how to use str() and the type of data it accepts and returns. - help 6. Which of the following is an invalid statement? a. abc = 1,000,000 b. a b c = c. a,b,c = 1, 2, 3 d. a_b_c = 4,000,000 - b. a b c = 7. Which one of the following have the highest precedence in the expression? a. Exponential b. Addition c. Multiplication d. Parentheses - d. Parentheses 8. Following set of commands are executed in shell, what will be the output? >>> str = "hello" >>> str[:2] >>> - he; because you are printing only the first two bytes of string. 9. The following is displayed after a print() call: tom dick harry 10. Select the function call that results in this output a. print("ttom tdick tharry") b. print("ttom tdick tharry") c. print(" tom dick harry") d. print("ttomntdickntharry") - d. print("ttomntdickntharry") 11. What is the output of the following code: x = ['ab', 'cd'] for i in x: i. upper() print(x) - ['ab', 'cd'] 12. What is the output of the following? True = False while True: print(True
Written for
- Institution
- Programming for python language..
- Course
- Programming for python language..
Document information
- Uploaded on
- June 8, 2024
- Number of pages
- 6
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
python exam challenge questions with merged solut