{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Tutorial A4" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__1__ Can you answer these questions?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - What is a Python object?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - How would you assign a value to a variable?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - How can you know, something is an object in Python?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - How can you know a Python object is a function?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - How can you get an overview of all the attributes of an object?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - How can you discover all objects currently available?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__2__ Call `help()` on the built-in Python function `help` to see what it does. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__3__ Which methods (disregarding double underscore methods `__method__`) does a `str` object have? Try out those of them that deal with case-formatting (upper/lower case letters) with an example of your choice and explain shortly what they do." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__4__ Which methods (disregarding double underscore methods `__method__`) does a `complex` object have? Try out all of them with an example of your choice and explain shortly what they do." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__5__ When you call `print(string)`, the value of `string` is printed to the screen. Call `help()` on the built-in Python function `print` to see what it does. Can you figure out just by reading the help message how to automatically print an exclamation mark (`!`) after the print? " ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.10" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 4 }