1
+ {
2
+ "nbformat" : 4 ,
3
+ "nbformat_minor" : 0 ,
4
+ "metadata" : {
5
+ "colab" : {
6
+ "provenance" : [],
7
+ "authorship_tag" : " ABX9TyPaubeDU018lLarUahRpkgN" ,
8
+ "include_colab_link" : true
9
+ },
10
+ "kernelspec" : {
11
+ "name" : " python3" ,
12
+ "display_name" : " Python 3"
13
+ },
14
+ "language_info" : {
15
+ "name" : " python"
16
+ }
17
+ },
18
+ "cells" : [
19
+ {
20
+ "cell_type" : " markdown" ,
21
+ "metadata" : {
22
+ "id" : " view-in-github" ,
23
+ "colab_type" : " text"
24
+ },
25
+ "source" : [
26
+ " <a href=\" https://colab.research.google.com/github/luasampaio/Python/blob/master/lambda.ipynb\" target=\" _parent\" ><img src=\" https://colab.research.google.com/assets/colab-badge.svg\" alt=\" Open In Colab\" /></a>"
27
+ ]
28
+ },
29
+ {
30
+ "cell_type" : " code" ,
31
+ "source" : [
32
+ " # Instala o pacote watermark. Utilizado para obter informações sobre as versões de outros pacotes utilizados neste Jupyter Notebook.\n " ,
33
+ " # https://pypi.org/project/watermark/\n " ,
34
+ " %pip install -q watermark"
35
+ ],
36
+ "metadata" : {
37
+ "id" : " SLAVbFz_609s"
38
+ },
39
+ "execution_count" : 1 ,
40
+ "outputs" : []
41
+ },
42
+ {
43
+ "cell_type" : " code" ,
44
+ "source" : [
45
+ " # Carrega o pacote watermark como um comando mágico no Jupyter Notebook.\n " ,
46
+ " %load_ext watermark"
47
+ ],
48
+ "metadata" : {
49
+ "id" : " FcpS556p7BpH"
50
+ },
51
+ "execution_count" : 2 ,
52
+ "outputs" : []
53
+ },
54
+ {
55
+ "cell_type" : " code" ,
56
+ "source" : [
57
+ " # Versão do Python e de todos os pacotes importados neste projeto.\n " ,
58
+ " %watermark -a \" Luciana Sampaio\" -gu \" luasampaio\" --python --iversions --watermark"
59
+ ],
60
+ "metadata" : {
61
+ "colab" : {
62
+ "base_uri" : " https://localhost:8080/"
63
+ },
64
+ "id" : " MzOfA6--7F2h" ,
65
+ "outputId" : " afa5ccb5-dd33-4256-bc34-1fe8693a4d68"
66
+ },
67
+ "execution_count" : 3 ,
68
+ "outputs" : [
69
+ {
70
+ "output_type" : " stream" ,
71
+ "name" : " stdout" ,
72
+ "text" : [
73
+ " Author: Luciana Sampaio\n " ,
74
+ " \n " ,
75
+ " Github username: luasampaio\n " ,
76
+ " \n " ,
77
+ " Python implementation: CPython\n " ,
78
+ " Python version : 3.10.12\n " ,
79
+ " IPython version : 7.34.0\n " ,
80
+ " \n " ,
81
+ " Watermark: 2.4.3\n " ,
82
+ " \n "
83
+ ]
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ "cell_type" : " code" ,
89
+ "execution_count" : 4 ,
90
+ "metadata" : {
91
+ "colab" : {
92
+ "base_uri" : " https://localhost:8080/"
93
+ },
94
+ "id" : " 6XA6Y2vp6Kgu" ,
95
+ "outputId" : " de5f9a6a-8b3f-4f9e-b644-8225ce8b506f"
96
+ },
97
+ "outputs" : [
98
+ {
99
+ "output_type" : " stream" ,
100
+ "name" : " stdout" ,
101
+ "text" : [
102
+ " 6\n "
103
+ ]
104
+ }
105
+ ],
106
+ "source" : [
107
+ " #Função regular\n " ,
108
+ " def soma (x, y):\n " ,
109
+ " return x + y\n " ,
110
+ " \n " ,
111
+ " \n " ,
112
+ " valor1 = soma(2,4)\n " ,
113
+ " \n " ,
114
+ " print(valor1)"
115
+ ]
116
+ },
117
+ {
118
+ "cell_type" : " code" ,
119
+ "source" : [
120
+ " # Função Lambda\n " ,
121
+ " soma = lambda x, y: print(x + y)\n "
122
+ ],
123
+ "metadata" : {
124
+ "id" : " fREoJMmC6T2K"
125
+ },
126
+ "execution_count" : 6 ,
127
+ "outputs" : []
128
+ },
129
+ {
130
+ "cell_type" : " code" ,
131
+ "source" : [
132
+ " soma (5,6)"
133
+ ],
134
+ "metadata" : {
135
+ "colab" : {
136
+ "base_uri" : " https://localhost:8080/"
137
+ },
138
+ "id" : " 0VcHmV3l6dvf" ,
139
+ "outputId" : " 52dff6cf-d116-425a-cc19-08c7aa422ea3"
140
+ },
141
+ "execution_count" : 7 ,
142
+ "outputs" : [
143
+ {
144
+ "output_type" : " stream" ,
145
+ "name" : " stdout" ,
146
+ "text" : [
147
+ " 11\n "
148
+ ]
149
+ }
150
+ ]
151
+ },
152
+ {
153
+ "cell_type" : " code" ,
154
+ "source" : [],
155
+ "metadata" : {
156
+ "id" : " LQKVjA7J6gE8"
157
+ },
158
+ "execution_count" : 7 ,
159
+ "outputs" : []
160
+ }
161
+ ]
162
+ }
0 commit comments