PythonByteSize
  • Home
  • Video Index
    • 1. The Basics
    • 2. Python Program Structures
    • 3. Python Operators
    • 4. Python Functions
    • 5. Introduction to Classes and Objects
    • 6. Python Strings
    • 7. User Defined Functions
    • 8. Classes and Objects
    • 9. Python Dictionaries
    • 10. Python tkinter
    • 11. Python Lists
    • 12. Python Namespaces
    • 13. Turtle Graphics
    • 14. Python Tips
    • 15. Complex Numbers
  • 1-Minute Videos
  • Exercise Index
    • 1. The Basics Exercises
    • 2. Python Program Structures Exercises
    • 3. Python Operators Exercises
    • 4. Python Functions Exercises
  • Donate
  • Computing Topics
  • Mathematics
  • Educators
  • Contact
  • About

Exercise 1.8. (Python Variables and Data Types)

the_basics_lesson_8_exercise.pdf
File Size: 258 kb
File Type: pdf
Download File


1. Ensure you have viewed the video (associated with this exercise) at this link >>

2. Fill in the blank for the following description of a program variable:

    Program variables are reserved ___________ locations used to store data

3. In your own words describe what is meant by a variable identifier and a variable value..

4. Program variables have data types such as: Integer; Float and String. After the execution of the following snippet of code what are the data type of the three variables var_one, var_two and var_three?
Picture

5. Run the code snippet below to assist you with the answer to the question above (i.e. Step 4). Note type(var_one) 'reports' the type of the variable in its brackets.
Picture

6. The Data type of a variable defines the way in which the variable can be processed. With this in mind what will happen when the following snippet of code is executed.
Picture

7. Enter and run the code shown above to check your answer to the question in Step 6.

8. Enter and run the code shown below did it work in the way you expected?
Picture

END    Next Exercise >>

Please consider donating to help with the costs incurred in developing this website.             Donate >>