COURSE 2: GET STARTED WITH PYTHON

Spread the love

Module 1: Hello, Python!

INTRODUCTION – Hello, Python!

You will start by learning the basics of Python programming and how it is a tool for a whole range of things, including data analysis. An introduction shall also include Jupyter Notebooks-a very handy coding and data work environment. You will know how to make and use variables and associated data types in order to store and organize data and acquire important coding skills.

Learning Objectives:

  • Become proficient in converting data types into one another in Python.
  • Define and differentiate base data types like integer, float, or string.
  • Know the conventions of variable names in Python.
  • Be aware of assigning values to variables as a process and a purpose.
  • Understand objects, classes, methods, and attributes as part of object-oriented programming.
  • They recognize the benefit of using Jupyter Notebooks for data analysis.
  • Identify the basic characteristics and capabilities of Python as a programming language.
  • Learn how to import modules into Python scripts using the import keyword.
  • Explore Jupyter Notebooks like a Python environment for interactive work.
  • Arithmetically perform by Python.
  • Do built-in functions and keywords.
  • Exploring the ways in which Python applies itself to data science.
  • Python packages and interpreting options.
  • The nature of algorithms in Python.
  • Benefits of Python skills in data-given careers.
  • Explain what Python and syntax mean.

PRACTICE QUIZ: TEST YOUR KNOWLEDGE: GET STARTED WITH THE COURSE

1. Fill in the blank: Computer _____ refers to the process of giving instructions to a computer to perform an action or set of actions.

  • analyzing
  • visualizing
  • programming (CORRECT)
  • science

Correct: The art of computer programming consists of writing and designing those specific instructions which a computer will follow in order to carry out some computation or to perform an action.

2. In Python, what is a library?

  • A sequence of data visualizations
  • The words and symbols used to write instructions for computers to follow
  • A reusable collection of code (CORRECT)
  • A chain of transistors

Correct: In Python, a library is a reusable collection of code.

3. Python is a low-level programming language.

  • True
  • False (CORRECT)

Correct: Python, however, is programming language that works at a much higher level up than where the low-level programming languages are written. The low-level programming languages are harder to handle, require robust training for extracting the meaning, and are exclusive for the machines.

PRACTICE QUIZ: THE POWER OF PYTHON

1. Fill in the blank: Jupyter Notebook is an open source _____ for creating and sharing documents containing live code, mathematical formulas, visualizations, and text.

  • web application (CORRECT)
  • dot notation
  • library
  • programming language

Correct: Jupyter Notebook is a program open to the public on the web, which a user can use to create hashed documents that can include live code, mathematical formulas, visualizations, and text itself.

2. In object-oriented programming, objects can contain both data and useful code that manipulates that data.

  • False
  • True (CORRECT)

Correct: In object-oriented programming, an object can enclose both properties and methods in one unit.

3. What are examples of classes in Python? Select all that apply.

  • Cells
  • Integers (CORRECT)
  • Floats (CORRECT)
  • Strings (CORRECT)

Correct: It is said that in the paradigm of object orientation, the object can encapsulate not only its data but also the methods that do operations on that data.

PRACTICE QUIZ: TEST YOUR KNOWLEDGE: USING PYTHON SYNTAX

1. Variables can only store values of numeric data types.

  • True
  • False (CORRECT)

Correct: In Object-oriented programming, an object is a combination of data and the operations that can beperformed on that data.

2. What are best practices when assigning a new variable? Select all that apply.

  • Determine the variable’s keyword
  • Determine the variable’s starting value (CORRECT)
  • Determine the variable’s name (CORRECT)
  • Determine the variable’s data type (CORRECT)

Correct: Object-oriented programming, along with data, is also meant to encapsulate the associated methods for its manipulation.

3. Fill in the blank: An _____ is a combination of numbers, symbols, or other variables that produce a result when evaluated.

  • argument
  • attribute
  • expression (CORRECT)
  • object

Correct: In object-oriented programming, objects can hold variables and the actual methods that perform operations on those variables.

4. Which data type represents numbers that contain decimals?

  • Integer
  • Float (CORRECT)
  • String
  • Boolean

Correct: The float data type represents numbers that contain decimals.

QUIZ: MODULE 1 CHALLENGE

1. A data team researches which programming language they can use  to perform their coding work most effectively. They want a language that is easy to learn and has a supportive user community. Ultimately, they select Python. What are some other benefits of using Python for coding? Select all that apply.

  • Python is a low-level language.
  • Python is versatile. (CORRECT)
  • Python has thousands of open-source libraries. (CORRECT)
  • Python is based on simple syntax. (CORRECT)

Correct!

2. Fill in the blank: The open-source web application _____ enables users to share documents containing live code, mathematical formulas, visualizations, and text. It also puts all output into a single document, which is very useful when first learning about programming.

  • Dynamic coding
  • Dot notation
  • Implicit analysis
  • Jupyter Notebook (CORRECT)

Correct!

3. Fill in the blank: In Python, a _____ is a function that belongs to a class and typically performs an action or operation.

  • Method (CORRECT)
  • cell
  • string
  • keyword

Correct!

4. Fill in the blank: _____ is the process of storing a value in a variable.

  • Assignment (CORRECT)
  • Expression
  • Conversion
  • Syntax

Correct!

5. A data professional names a variable in Python, then receives an error message. What might they have included in the name incorrectly? Select all that apply.

  • More than one underscore
  • More than one number
  • Reserved functions (CORRECT)
  • Reserved keywords (CORRECT)

Correct!

6. Which of the following is an effective variable name?

  • able_variable (CORRECT)
  • able(variable)
  • 5_able_variables
  • _able_int_variable

Correct!

7. In Python, which data type represents a sequence of characters and punctuation that contains textual information?

  • Boolean
  • String (CORRECT)
  • Float
  • Integer

Correct!

8. A data professional converts integers into strings using a predefined function. This is an example of what type of conversion?

  • Mutable conversion
  • Immutable conversion
  • Implicit conversion
  • Explicit conversion (CORRECT)

Correct!

9. A data professional investigates which programming language they can use to perform their coding work most effectively. They want to use a versatile language based on simple syntax. Ultimately, they select Python. What are some other benefits of using Python for coding? Select all that apply.

  • Python is a low-level language.
  • Python is easy to learn. (CORRECT)
  • Python has a large and supportive community of users. (CORRECT)
  • Python has thousands of open source libraries available for use. (CORRECT)

Correct!

10. In Python, what describes the process of storing a value in a variable?

  • Conversion
  • Expression
  • Syntax
  • Assignment (CORRECT)

Correct!

11. A data professional names a variable in Python, then receives an error message. Which of the following elements may have caused the error? Select all that apply.

  • Letter
  • Underscore
  • Tab (CORRECT)
  • Ampersand (CORRECT)

Correct!

12. In Python, which data type represents whole numbers without fractions?

  • Integer (CORRECT)
  • Float
  • Boolean
  • String

Correct!

13. A data professional performs a calculation involving integers and floats. Python automatically converts the integers to floats. This is an example of what type of conversion?

  • Mutable conversion
  • Explicit conversion
  • Implicit conversion (CORRECT)
  • Immutable conversion

Correct!

14. Fill in the blank: The open-source web application _____ enables data professionals to modularize code into cells in order to organize them in sections, as well as collaborate on data projects and integrate code.

  • Jupyter Notebook (CORRECT)
  • Dot notation
  • Dynamic coding
  • Implicit analysis

Correct!

15. A data professional names a variable in Python. To ensure they follow proper naming conventions, what may the variable name contain? Select all that apply.

  • Reserved keywords
  • Numbers (CORRECT)
  • Underscores (CORRECT)
  • Letters (CORRECT)

Correct!

16. In Python, which data type represents numbers that contain decimals?

  • Float (CORRECT)
  • Boolean
  • Integer
  • String

Correct!

17. A manager explores which programming language their team can use to perform coding work most effectively. They want a language with thousands of open-source libraries for reference. Ultimately, they select Python. What are some other benefits of using Python for coding? Select all that apply.

  • Python is a low-level language.
  • Python has a large and supportive user community. (CORRECT)
  • Python is based on simple syntax. (CORRECT)
  • Python is versatile. (CORRECT)

Correct!

18. Fill in the blank: In Python, a _____ is an object’s data type that bundles data and functionality together.

  • Class (CORRECT)
  • keyword
  • float
  • method

Correct!

19. In Python, what does assignment refer to?

  • A value associated with an object or class which is referenced by name using dot notation
  • A sequence of characters and punctuation that contains textual information
  • The process of storing a value in a variable (CORRECT)
  • A combination of numbers, symbols, or other variables that produce a result when evaluated

Correct!

20. Fill in the blank: In Python, an _____ is a value associated with an object or class which is referenced by name using dot notation.

  • integer
  • assignment
  • expression
  • attribute (CORRECT)

Correct!

21. Which of the following is an effective variable name? Mark all that apply.

  • fun(variables)
  • fun variable$
  • fun_with_variables (CORRECT)
  • fun_for_variables (CORRECT)

Correct!

22. A data professional converts floats into strings using a predefined function. This is an example of what type of conversion?

  • Implicit conversion
  • Immutable conversion
  • Mutable conversion
  • Explicit conversion (CORRECT)

Correct!

23. There are four fundamental concepts in object-oriented programming, including objects. What are the other three concepts? Select all that apply.

  • Operators
  • Classes (CORRECT)
  • Methods (CORRECT)
  • Attributes (CORRECT)

Correct: Encapsulation can include data and methods that manipulate that data, using the objects in object-oriented programming.

24. Fill in the blank: Naming _____ are rules built into the syntax of the language itself that must be followed.

  • expressions
  • keywords
  • restrictions (CORRECT)
  • assignments

Correct: Naming restrictions are the stricter rules from the construct of a programming language syntax that lay out the frameworks under which identifiers, like those for variables, functions, or classes, can be created. Logic must be put into place to avoid problems and maintain the code’s ability to run correctly.

25. Fill in the blank: The _____ data type is a sequence of characters and punctuation that contains textual information.

  • String (CORRECT)
  • float
  • integer
  • assignment

Correct: A string is a type of data that includes series of letters, numbers, symbols, and punctuation marks to represent specific types of information.

Leave a Comment