Computer Programming (e.g., MATLAB, Python) β MCQs 50 Score: 0 Attempted: 0/50 Subscribe 1. Which of the following is a high-level, interpreted programming language widely used for data science? (A) C (B) Python (C) Java (D) Assembly 2. MATLAB is primarily used for: (A) Web development (B) Numerical computing (C) Game design (D) Operating systems 3. In Python, which symbol is used for comments? (A) // (B) /* */ (C) # (D) % 4. In MATLAB, the symbol used for comments is: (A) // (B) # (C) % (D) — 5. Which Python function is used to display output? (A) echo() (B) display() (C) print() (D) show() 6. Which MATLAB command is used to display output? (A) print (B) show (C) disp (D) echo 7. Which of the following is a mutable data type in Python? (A) Tuple (B) List (C) String (D) Integer 8. In Python, immutable sequences are: (A) Sets (B) Lists (C) Tuples (D) Dictionaries 9. In MATLAB, arrays are: (A) Zero-indexed (B) One-indexed (C) Two-indexed (D) Random-indexed 10. In Python, arrays and lists are: (A) Zero-indexed (B) One-indexed (C) Negative-indexed only (D) Random-indexed 11. Which operator is used for exponentiation in Python? (A) ^ (B) ** (C) ^^ (D) % 12. Which operator is used for exponentiation in MATLAB? (A) ^ (B) ** (C) ^^ (D) % 13. Which Python library is commonly used for numerical computing? (A) pandas (B) NumPy (C) matplotlib (D) seaborn 14. Which MATLAB function is used to create a linearly spaced vector? (A) range() (B) linspace() (C) arange() (D) vector() 15. In Python, which library is primarily used for data visualization? (A) pandas (B) seaborn (C) matplotlib (D) scipy 16. Which MATLAB function is used to plot data? (A) plot() (B) show() (C) draw() (D) graph() 17. Which function in Python returns the length of a list? (A) count() (B) len() (C) size() (D) length() 18. In MATLAB, which function returns the size of a matrix? (A) size() (B) length() (C) rows() (D) dim() 19. Which loop is not available in Python? (A) for (B) while (C) do-while (D) nested-for 20. Which loop is not available in MATLAB? (A) for (B) while (C) do-while (D) nested-for 21. In Python, indentation is used to: (A) Define loops and conditionals (B) Improve readability only (C) Separate functions only (D) Mark end of code 22. In MATLAB, code blocks are defined by: (A) Indentation (B) Curly braces (C) Keywords like “end” (D) Semicolons 23. Which of the following is used to read input in Python? (A) input() (B) scanf() (D) read() 24. In MATLAB, how do you suppress output of a command? (A) Using , (B) Using ; (C) Using # (D) Using % 25. In Python, a dictionary stores data as: (A) Key-value pairs (B) Sequential values (C) Single characters (D) Binary data 26. MATLAB primarily uses which data structure for storing values? (A) Linked lists (B) Arrays (C) Hashmaps (D) Trees 27. Which keyword is used to define a function in Python? (A) def (B) func (C) function (D) define 28. Which keyword is used to define a function in MATLAB? (A) def (B) function (C) func (D) define 29. Which of the following is a Python IDE? (A) Jupyter Notebook (B) Spyder (C) PyCharm (D) All of the above 30. Which of the following is a MATLAB IDE? (A) MATLAB Desktop (B) Jupyter (C) RStudio (D) Spyder 31. In Python, which symbol is used for floor division? (A) / (B) // (C) %% (D) ^ 32. In MATLAB, element-wise multiplication is done using: (A) * (B) .* (C) ** (D) ^ 33. Which Python library is widely used for data analysis? (A) seaborn (B) pandas (C) scikit-learn (D) numpy 34. Which MATLAB command is used to clear all variables? (A) clear (B) reset (C) delete (D) clc 35. Which Python function converts a string into an integer? (A) str() (B) float() (C) int() (D) eval() 36. In MATLAB, which function converts a string to a number? (A) str2num() (B) int() (C) num2str() (D) float() 37. Which Python statement is used for exception handling? (A) try-except (B) do-catch (C) error-handling (D) exception 38. Which MATLAB statement is used for error handling? (A) try-catch (B) exception (C) error-handling (D) protect 39. In Python, which library is mainly used for machine learning? (A) numpy (B) sklearn (C) matplotlib (D) seaborn 40. Which of these is not a valid Python data type? (A) List (B) Set (C) Dictionary (D) Matrix 41. Which MATLAB function is used to find eigenvalues? (A) det() (B) eig() (C) inv() (D) rank() 42. In Python, which keyword is used to exit a loop prematurely? (A) stop (B) exit (C) break (D) return 43. In MATLAB, which function is used for Fourier Transform? (A) fft() (B) dft() (C) fourier() (D) ftransform() 44. Which Python module is used for regular expressions? (A) regex (B) re (C) reg (D) expr 45. Which MATLAB function generates random numbers between 0 and 1? (A) rand() (B) random() (C) randint() (D) randnum() 46. In Python, which keyword defines a class? (A) function (B) object (C) class (D) def 47. In MATLAB, which function saves workspace data to a file? (A) save() (B) store() (C) write() (D) export() 48. In Python, which operator is used for logical AND? (A) & (B) and (C) && (D) || 49. In MATLAB, which operator is used for logical AND? (A) & (B) and (C) && (D) both A and C 50. Which language is considered more efficient for large-scale numerical computing? (A) Python (B) MATLAB (C) Both equally (D) None Β FOUNDATIONAL SUBJECTS (Year 1 – Year 2)Engineering Mechanics (Statics & Dynamics) β MCQsFluid Mechanics β MCQsThermodynamics β MCQsComputer Programming (e.g., MATLAB, Python) β MCQsIntroduction to Engineering β MCQsGeology for Engineers β MCQsTechnical Communication β MCQsΒ CORE PETROLEUM ENGINEERING SUBJECTS (Year 2 – Year 4)Introduction to Petroleum Engineering β MCQsPetroleum Geology β MCQsDrilling Engineering β MCQsReservoir Engineering β MCQsProduction Engineering β MCQsPetroleum Fluid Properties β MCQsWell Logging and Formation Evaluation β MCQsPetroleum Economics β MCQsPetroleum Refining and Processing β MCQs Β Natural Gas Engineering β MCQsEnhanced Oil Recovery (EOR) β MCQsWell Testing β MCQsReservoir Simulation β MCQsDrilling Fluids and Cementing β MCQsOffshore Petroleum Engineering β MCQsHealth, Safety and Environment (HSE) β MCQsPetroleum Project Management β MCQsCorrosion Engineering β MCQsArtificial Lift Techniques β MCQsPetrophysics β MCQsΒ LABORATORIES & PRACTICALS (Theory-based MCQs can be made from these)Drilling Fluids Lab β MCQsCore Analysis Lab β MCQsReservoir Simulation Lab β MCQsRock and Fluid Properties Lab β MCQsWell Logging Lab β MCQsΒ ELECTIVES (Optional/Advanced)Energy Transition and Sustainability β MCQsUnconventional Resources (Shale, Tight Gas, etc.) β MCQsData Analytics in Petroleum Engineering β MCQsGeographic Information Systems (GIS) β MCQsPetroleum Law and Policy β MCQsPipeline Engineering β MCQsRenewable Energy Integration β MCQs