{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "view-in-github", "colab_type": "text" }, "source": [ "\"Open" ] }, { "cell_type": "markdown", "id": "c3baf958", "metadata": { "id": "c3baf958" }, "source": [ "# Tabla de verdad" ] }, { "cell_type": "markdown", "id": "202cb483", "metadata": { "id": "202cb483" }, "source": [ "![tabla de verdad](https://github.com/financieras/pyCourse/blob/main/jupyter/img/tablaverdad.png?raw=1)" ] }, { "cell_type": "code", "execution_count": 1, "id": "ef48ccd3", "metadata": { "id": "ef48ccd3", "outputId": "f745bdbc-92c2-4e9f-bc90-3cb319f88643", "colab": { "base_uri": "https://localhost:8080/" } }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "True" ] }, "metadata": {}, "execution_count": 1 } ], "source": [ "a = True\n", "b = True\n", "c = True\n", "a and b and c # con and es necesario que todos sean True para que resulte True" ] }, { "cell_type": "code", "execution_count": 2, "id": "8308fe8d", "metadata": { "id": "8308fe8d", "outputId": "8a2fc843-a24d-48da-d785-c13287713e59", "colab": { "base_uri": "https://localhost:8080/" } }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "False" ] }, "metadata": {}, "execution_count": 2 } ], "source": [ "a = True\n", "b = True\n", "c = False\n", "a and b and c # con and basta que uno sea False para que que resulte False" ] }, { "cell_type": "code", "execution_count": 3, "id": "844fe2b1", "metadata": { "id": "844fe2b1", "outputId": "033ff361-57ff-47a2-e1d8-bb79b8be45a0", "colab": { "base_uri": "https://localhost:8080/" } }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "True" ] }, "metadata": {}, "execution_count": 3 } ], "source": [ "a = True\n", "b = False\n", "c = False\n", "a or b or c # con or es basta que uno sea True para que resulte True" ] }, { "cell_type": "code", "execution_count": 4, "id": "6c296488", "metadata": { "id": "6c296488", "outputId": "9f9afa72-2863-4dc0-8f1e-f242b4101909", "colab": { "base_uri": "https://localhost:8080/" } }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "False" ] }, "metadata": {}, "execution_count": 4 } ], "source": [ "a = False\n", "b = False\n", "c = False\n", "a or b or c # con or es necesario que todos sean False para que resulte True" ] }, { "cell_type": "code", "execution_count": 5, "id": "000b44b1", "metadata": { "id": "000b44b1", "outputId": "7dfbb37b-ce48-4a63-e3e2-6b0a08c12a14", "colab": { "base_uri": "https://localhost:8080/" } }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "False" ] }, "metadata": {}, "execution_count": 5 } ], "source": [ "a = True\n", "not(a) # not cambia el booleano, si es True lo convierte en False" ] }, { "cell_type": "code", "execution_count": 6, "id": "a10d74f0", "metadata": { "id": "a10d74f0", "outputId": "9617cc66-3f24-4ab6-857b-012ec2d7ac0e", "colab": { "base_uri": "https://localhost:8080/" } }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "True" ] }, "metadata": {}, "execution_count": 6 } ], "source": [ "a = False\n", "not(a) # not cambia el booleano, si es False lo convierte en True" ] } ], "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.8.8" }, "colab": { "name": "0330_tabla_de_verdad.ipynb", "provenance": [], "include_colab_link": true } }, "nbformat": 4, "nbformat_minor": 5 }