Table of contents |
|
Multiple Choice Questions |
|
Fill in the Blanks |
|
True or False |
|
Short Answer Questions |
|
Long Answer Questions |
|
Q.1: What is Anaconda primarily used for?
a) Web development
b) Scientific computing
c) Game development
d) Mobile app development
Ans: b) Scientific computing
Explanation: Anaconda is a free and open-source distribution of Python used for scientific computing, including data science, machine learning, large-scale data processing, and predictive analytics.
Q.2: What is the purpose of Anaconda Navigator?
a) To write Python code
b) To manage conda packages, environments, and run programs without command line
c) To compile Python programs
d) To create virtual environments automatically
Ans: b) To manage conda packages, environments, and run programs without command line
Explanation: Anaconda Navigator is a user-friendly desktop interface that allows users to manage conda packages, environments, and channels, and run programs without using command line commands.
Q.3: What is the default kernel for Jupyter Notebook?
a) Python Shell
b) IPython
c) nb_conda
d) Anaconda Prompt
Ans: b) IPython
Explanation: The default kernel for Jupyter Notebook is IPython, which provides programming language support for Python code execution.
Q.4: Which menu in Jupyter Notebook allows you to create checkpoints?
a) Edit Menu
b) View Menu
c) File Menu
d) Kernel Menu
Ans: c) File Menu
Explanation: The File Menu in Jupyter Notebook includes the 'Save and Checkpoint' option, which allows users to create checkpoints to roll back to if needed.
Q.5: Why is Python preferred for AI applications?
a) It is a compiled language
b) It has a simple syntax and extensive libraries
c) It is limited to web development
d) It lacks database connectivity
Ans: b) It has a simple syntax and extensive libraries
Explanation: Python is preferred for AI due to its simplicity, clear syntax, and extensive libraries that are useful for a wide range of problems.
Q.6: Which Python data type is used to store decimal number values?
a) Int
b) Float
c) Complex
d) Boolean
Ans: b) Float
Explanation: The Float data type is used to store decimal number values, such as 50.5.
Q.7: Which symbol is used to start a single-line comment in Python?
a) //
b) /*
c) #
d) --
Ans: c) #
Explanation: A single-line comment in Python begins with the hash symbol (#) and continues until the end of the line.
Q.8: Which operator is used to assign a value to a variable in Python?
a) ==
b) =
c) !=
d) >=
Ans: b) =
Explanation: The assignment operator (=) is used to assign values to variables in Python.
Q.9: What does the elif
statement do in Python?
a) Executes a loop
b) Checks another condition if the previous condition is false
c) Assigns a value to a variable
d) Terminates a program
Ans: b) Checks another condition if the previous condition is false
Explanation: The
elif
statement (else if) checks another condition if the previousif
orelif
condition is false.
Q.10: Which loop is used to repeat a block of code a specified number of times?
a) While loop
b) For loop
c) Nested loop
d) If loop
Ans: b) For loop
Explanation: The for loop is used to specify how many times a statement or compound statement should be repeated.
Q.1: Anaconda simplifies __________ management and deployment for Python projects.
Ans: package
Explanation: Anaconda simplifies package management and deployment, allowing users to create virtual environments with different packages and settings.
Q.2: The __________ is a desktop interface for managing Anaconda environments and packages.
Ans: Anaconda Navigator
Explanation: Anaconda Navigator is a user-friendly desktop interface for managing conda packages, environments, and running programs.
Q.3: Jupyter Notebook requires a __________ to provide programming language support.
Ans: kernel
Explanation: A kernel, such as IPython, provides programming language support for Jupyter Notebook to execute code.
Q.4: In Python, a __________ is a name given to a variable, function, or class.
Ans: identifier
Explanation: An identifier is a name given to a variable, function, class, module, or other object in Python.
Q.5: The __________ data type in Python is used to store unordered data without indexes.
Ans: set
Explanation: A set is a collection of unordered data without indexes, declared using curly brackets.
Q.1: Anaconda is only used for web development projects.
Ans: False
Explanation: Anaconda is used for scientific computing, including data science, machine learning, and predictive analytics, not just web development.
Q.2: Jupyter Notebook supports multiple programming languages besides Python.
Ans: True
Explanation: Jupyter Notebook can support multiple programming languages, although Python is the most common via its default IPython kernel.
Q.3: In Python, keywords can be used as variable names.
Ans: False
Explanation: Keywords are reserved words in Python and cannot be used as variable names, function names, or identifiers.
Q.4: Implicit type conversion in Python requires user intervention.
Ans: False
Explanation: Implicit type conversion is done automatically by Python without user intervention, such as converting an integer to a float during division.
Q.5: The while
loop in Python executes as long as a condition is true.
Ans: True
Explanation: The while loop repeatedly executes a block of statements as long as a specified condition remains true.
Q.1: What is the role of Anaconda Navigator in managing Python projects?
Ans: Anaconda Navigator is a user-friendly desktop interface that allows users to manage conda packages, environments, and channels, and run programs without using command line commands, simplifying project management.
Explanation: Anaconda Navigator provides a graphical interface to manage Python environments and packages, making it easier to navigate and manage projects without command line expertise.
Q.2: Why is Jupyter Notebook considered effective for AI-related projects?
Ans: Jupyter Notebook is effective for AI projects because it mixes code, graphics, narrative prose, and mathematical equations in a single interactive document, encouraging iterative and rapid improvement.
Explanation: The interactive nature of Jupyter Notebook, combining code with visualizations and text, supports the iterative development process critical for AI projects.
Q.3: What are the rules for creating a valid identifier in Python?
Ans: A valid identifier in Python must start with a letter or underscore, can include alphanumeric characters and underscores, cannot use special characters like !, @, #, $, %, and cannot be a keyword. Python is case-sensitive.
Explanation: Identifiers must follow specific rules to ensure they are valid and do not conflict with Python’s reserved keywords or syntax.
Q.4: Explain the difference between implicit and explicit type conversion in Python.
Ans: Implicit type conversion is automatic, where Python converts one data type to another without user intervention (e.g., int to float during division). Explicit type conversion requires the user to use predefined functions like int()
, float()
, or str()
to convert data types.
Explanation: Implicit conversion happens automatically, while explicit conversion, or typecasting, requires user-defined functions to change data types.
Q.5: Describe the purpose of the if…else
statement in Python.
Ans: The if…else
statement controls the flow of execution by running a block of code if a condition is true and an alternative block if the condition is false, enabling decision-making based on conditions.
Explanation: The if…else
statement allows programs to execute different code paths based on whether a specified condition evaluates to true or false.
Q.1: Explain the steps to install Anaconda on a Windows operating system.
Ans: To install Anaconda on Windows:
Q.2: Describe the features of Jupyter Notebook’s menu bar and their functionalities.
Ans: The Jupyter Notebook menu bar includes:
Q.3: Discuss why Python is preferred for AI applications, highlighting its key advantages.
Ans: Python is the preferred language for AI applications due to:
Q.4: Explain the different Python data types with examples for each category.
Ans: Python data types include:
Numbers:
Sequences:
Sets: Unordered, no duplicates, e.g., newset = {10, 20, 30}.
Dictionary: Unordered key-value pairs, e.g., d = {1: 'Ajay', 'key': 2}. These data types support various programming needs in Python.
Q.5: Evaluate the importance of decision-making statements in Python and provide examples of different types.
Ans: Decision-making statements in Python are crucial for controlling the flow of execution based on conditions, allowing programs to make choices and execute different code paths. They enhance program flexibility and functionality. Types include:
Decision-making statements allow Python programs to handle conditional logic, making them essential for dynamic and responsive applications.
24 videos|87 docs|8 tests
|
1. What are the key features of Python that make it suitable for advanced programming? | ![]() |
2. How can one effectively use Python for data analysis? | ![]() |
3. What are common errors encountered in Python programming and how can they be resolved? | ![]() |
4. What role do libraries and frameworks play in Python programming? | ![]() |
5. How does object-oriented programming in Python enhance software development? | ![]() |