└── Lógica_de_programação_Aula_1.ipynb /Lógica_de_programação_Aula_1.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "Lógica de programação - Aula 1.ipynb", 7 | "provenance": [], 8 | "collapsed_sections": [] 9 | }, 10 | "kernelspec": { 11 | "name": "python3", 12 | "display_name": "Python 3" 13 | } 14 | }, 15 | "cells": [ 16 | { 17 | "cell_type": "markdown", 18 | "metadata": { 19 | "id": "qykoO5OSy07O", 20 | "colab_type": "text" 21 | }, 22 | "source": [ 23 | "# Lógica de programação com Python" 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "metadata": { 29 | "id": "XybiIX36yqTn", 30 | "colab_type": "code", 31 | "outputId": "a9a224bc-f8b8-42e7-c2c8-7b22e91a837e", 32 | "colab": { 33 | "base_uri": "https://localhost:8080/", 34 | "height": 34 35 | } 36 | }, 37 | "source": [ 38 | "1+1" 39 | ], 40 | "execution_count": 0, 41 | "outputs": [ 42 | { 43 | "output_type": "execute_result", 44 | "data": { 45 | "text/plain": [ 46 | "2" 47 | ] 48 | }, 49 | "metadata": { 50 | "tags": [] 51 | }, 52 | "execution_count": 87 53 | } 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "metadata": { 59 | "id": "8r6_2YWBy3Y0", 60 | "colab_type": "code", 61 | "colab": {} 62 | }, 63 | "source": [ 64 | "# Guilherme\n", 65 | "# NameError: name 'Guilherme' is not defined" 66 | ], 67 | "execution_count": 0, 68 | "outputs": [] 69 | }, 70 | { 71 | "cell_type": "code", 72 | "metadata": { 73 | "id": "5mV1IySTzXBS", 74 | "colab_type": "code", 75 | "outputId": "2d4e5668-4cd7-4c0d-8c40-09d21140ea2a", 76 | "colab": { 77 | "base_uri": "https://localhost:8080/", 78 | "height": 34 79 | } 80 | }, 81 | "source": [ 82 | "\"Guilherme\"" 83 | ], 84 | "execution_count": 0, 85 | "outputs": [ 86 | { 87 | "output_type": "execute_result", 88 | "data": { 89 | "text/plain": [ 90 | "'Guilherme'" 91 | ] 92 | }, 93 | "metadata": { 94 | "tags": [] 95 | }, 96 | "execution_count": 89 97 | } 98 | ] 99 | }, 100 | { 101 | "cell_type": "code", 102 | "metadata": { 103 | "id": "hsmmu-SozlFU", 104 | "colab_type": "code", 105 | "outputId": "a35cb411-08a9-4072-adce-8d166de888eb", 106 | "colab": { 107 | "base_uri": "https://localhost:8080/", 108 | "height": 34 109 | } 110 | }, 111 | "source": [ 112 | "'Guilherme'" 113 | ], 114 | "execution_count": 0, 115 | "outputs": [ 116 | { 117 | "output_type": "execute_result", 118 | "data": { 119 | "text/plain": [ 120 | "'Guilherme'" 121 | ] 122 | }, 123 | "metadata": { 124 | "tags": [] 125 | }, 126 | "execution_count": 90 127 | } 128 | ] 129 | }, 130 | { 131 | "cell_type": "code", 132 | "metadata": { 133 | "id": "8OltymtfznJ-", 134 | "colab_type": "code", 135 | "colab": {} 136 | }, 137 | "source": [ 138 | "nome = 'Guilherme'" 139 | ], 140 | "execution_count": 0, 141 | "outputs": [] 142 | }, 143 | { 144 | "cell_type": "code", 145 | "metadata": { 146 | "id": "Jcomfwmv0L2S", 147 | "colab_type": "code", 148 | "outputId": "ba6223b1-51bb-4bcd-a2bc-7438883dd267", 149 | "colab": { 150 | "base_uri": "https://localhost:8080/", 151 | "height": 34 152 | } 153 | }, 154 | "source": [ 155 | "nome" 156 | ], 157 | "execution_count": 0, 158 | "outputs": [ 159 | { 160 | "output_type": "execute_result", 161 | "data": { 162 | "text/plain": [ 163 | "'Guilherme'" 164 | ] 165 | }, 166 | "metadata": { 167 | "tags": [] 168 | }, 169 | "execution_count": 92 170 | } 171 | ] 172 | }, 173 | { 174 | "cell_type": "code", 175 | "metadata": { 176 | "id": "f7DCdMBq0M_x", 177 | "colab_type": "code", 178 | "outputId": "20f7f428-99e0-4a6b-b78d-1c655e6e4256", 179 | "colab": { 180 | "base_uri": "https://localhost:8080/", 181 | "height": 34 182 | } 183 | }, 184 | "source": [ 185 | "idade = 28\n", 186 | "idade" 187 | ], 188 | "execution_count": 0, 189 | "outputs": [ 190 | { 191 | "output_type": "execute_result", 192 | "data": { 193 | "text/plain": [ 194 | "28" 195 | ] 196 | }, 197 | "metadata": { 198 | "tags": [] 199 | }, 200 | "execution_count": 93 201 | } 202 | ] 203 | }, 204 | { 205 | "cell_type": "code", 206 | "metadata": { 207 | "id": "ZXmObjc50Qe8", 208 | "colab_type": "code", 209 | "outputId": "793bdc5f-c7ad-4f26-fbaa-f50029647635", 210 | "colab": { 211 | "base_uri": "https://localhost:8080/", 212 | "height": 34 213 | } 214 | }, 215 | "source": [ 216 | "print(f'O nome é {nome} e sua idade é {idade} anos.')" 217 | ], 218 | "execution_count": 0, 219 | "outputs": [ 220 | { 221 | "output_type": "stream", 222 | "text": [ 223 | "O nome é Guilherme e sua idade é 28 anos.\n" 224 | ], 225 | "name": "stdout" 226 | } 227 | ] 228 | }, 229 | { 230 | "cell_type": "code", 231 | "metadata": { 232 | "id": "M_7Prhz80j9y", 233 | "colab_type": "code", 234 | "colab": {} 235 | }, 236 | "source": [ 237 | "idade = 29" 238 | ], 239 | "execution_count": 0, 240 | "outputs": [] 241 | }, 242 | { 243 | "cell_type": "code", 244 | "metadata": { 245 | "id": "C0jbYDJB08yx", 246 | "colab_type": "code", 247 | "outputId": "cf63d7f5-cea8-4f94-b8c1-63f3828e51c3", 248 | "colab": { 249 | "base_uri": "https://localhost:8080/", 250 | "height": 34 251 | } 252 | }, 253 | "source": [ 254 | "print(f'O nome é {nome} e sua idade é {idade} anos.')" 255 | ], 256 | "execution_count": 0, 257 | "outputs": [ 258 | { 259 | "output_type": "stream", 260 | "text": [ 261 | "O nome é Guilherme e sua idade é 29 anos.\n" 262 | ], 263 | "name": "stdout" 264 | } 265 | ] 266 | }, 267 | { 268 | "cell_type": "markdown", 269 | "metadata": { 270 | "id": "LSAekw7l_OiS", 271 | "colab_type": "text" 272 | }, 273 | "source": [ 274 | "# Criando minha primeira função" 275 | ] 276 | }, 277 | { 278 | "cell_type": "code", 279 | "metadata": { 280 | "id": "436zJkir_SjS", 281 | "colab_type": "code", 282 | "colab": {} 283 | }, 284 | "source": [ 285 | "def saudacao():\n", 286 | " nome = input('Qual é o seu nome? ')\n", 287 | " print(f'Olá {nome}') " 288 | ], 289 | "execution_count": 0, 290 | "outputs": [] 291 | }, 292 | { 293 | "cell_type": "code", 294 | "metadata": { 295 | "id": "3fijU6z5AVxi", 296 | "colab_type": "code", 297 | "outputId": "c133c8e5-5c99-4572-f8db-cb6d32217f28", 298 | "colab": { 299 | "base_uri": "https://localhost:8080/", 300 | "height": 50 301 | } 302 | }, 303 | "source": [ 304 | "saudacao()" 305 | ], 306 | "execution_count": 0, 307 | "outputs": [ 308 | { 309 | "output_type": "stream", 310 | "text": [ 311 | "Qual é o seu nome? Gui\n", 312 | "Olá Gui\n" 313 | ], 314 | "name": "stdout" 315 | } 316 | ] 317 | } 318 | ] 319 | } --------------------------------------------------------------------------------