1
+ {
2
+ "nbformat" : 4 ,
3
+ "nbformat_minor" : 0 ,
4
+ "metadata" : {
5
+ "colab" : {
6
+ "name" : " Euler_8.ipynb" ,
7
+ "provenance" : [],
8
+ "authorship_tag" : " ABX9TyP98P7syK+9Gs2uS8jI23T6" ,
9
+ "include_colab_link" : true
10
+ },
11
+ "kernelspec" : {
12
+ "name" : " python3" ,
13
+ "display_name" : " Python 3"
14
+ },
15
+ "language_info" : {
16
+ "name" : " python"
17
+ }
18
+ },
19
+ "cells" : [
20
+ {
21
+ "cell_type" : " markdown" ,
22
+ "metadata" : {
23
+ "id" : " view-in-github" ,
24
+ "colab_type" : " text"
25
+ },
26
+ "source" : [
27
+ " <a href=\" https://colab.research.google.com/github/DebjitHore/Python-Codes/blob/master/Euler_8.ipynb\" target=\" _parent\" ><img src=\" https://colab.research.google.com/assets/colab-badge.svg\" alt=\" Open In Colab\" /></a>"
28
+ ]
29
+ },
30
+ {
31
+ "cell_type" : " code" ,
32
+ "metadata" : {
33
+ "id" : " 43NOXDTxp9OR"
34
+ },
35
+ "source" : [
36
+ " num=7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450\n " ,
37
+ " \n " ,
38
+ " \n " ,
39
+ " \n "
40
+ ],
41
+ "execution_count" : 2 ,
42
+ "outputs" : []
43
+ },
44
+ {
45
+ "cell_type" : " code" ,
46
+ "metadata" : {
47
+ "id" : " wTuLVZQ5qgfF"
48
+ },
49
+ "source" : [
50
+ " s=str(num)\n " ,
51
+ " mylist=list(s)\n " ,
52
+ " l=len(mylist)"
53
+ ],
54
+ "execution_count" : 20 ,
55
+ "outputs" : []
56
+ },
57
+ {
58
+ "cell_type" : " code" ,
59
+ "metadata" : {
60
+ "id" : " 24g2VqeisrxB"
61
+ },
62
+ "source" : [
63
+ " prodmax=0\n " ,
64
+ " prodmaxx=0\n " ,
65
+ " for i in range(0, l-13):\n " ,
66
+ " prod1= int(mylist[i])*int(mylist[i+1])*int(mylist[i+2])*int(mylist[i+3])*int(mylist[i+4])*int(mylist[i+5])*int(mylist[i+6])*int(mylist[i+7])*int(mylist[i+8])*int(mylist[i+9])*int(mylist[i+10])*int(mylist[i+11])*int(mylist[i+12])\n " ,
67
+ " prod2= int(mylist[i+1])*int(mylist[i+2])*int(mylist[i+3])*int(mylist[i+4])*int(mylist[i+5])*int(mylist[i+6])*int(mylist[i+7])*int(mylist[i+8])*int(mylist[i+9])*int(mylist[i+10])*int(mylist[i+11])*int(mylist[i+12])*int(mylist[i+13])\n " ,
68
+ " if prod1>prod2:\n " ,
69
+ " prodmax=prod1\n " ,
70
+ " else:\n " ,
71
+ " prodmax=prod2\n " ,
72
+ " if prodmax>prodmaxx:\n " ,
73
+ " prodmaxx=prodmax"
74
+ ],
75
+ "execution_count" : 34 ,
76
+ "outputs" : []
77
+ },
78
+ {
79
+ "cell_type" : " code" ,
80
+ "metadata" : {
81
+ "colab" : {
82
+ "base_uri" : " https://localhost:8080/"
83
+ },
84
+ "id" : " lvacuE50uodl" ,
85
+ "outputId" : " 69d29986-176a-4f1c-be6e-01152745891e"
86
+ },
87
+ "source" : [
88
+ " prodmaxx"
89
+ ],
90
+ "execution_count" : 35 ,
91
+ "outputs" : [
92
+ {
93
+ "output_type" : " execute_result" ,
94
+ "data" : {
95
+ "text/plain" : [
96
+ " 23514624000"
97
+ ]
98
+ },
99
+ "metadata" : {
100
+ "tags" : []
101
+ },
102
+ "execution_count" : 35
103
+ }
104
+ ]
105
+ },
106
+ {
107
+ "cell_type" : " code" ,
108
+ "metadata" : {
109
+ "colab" : {
110
+ "base_uri" : " https://localhost:8080/"
111
+ },
112
+ "id" : " VZEdFuilwMVE" ,
113
+ "outputId" : " 092e4e9a-9ea0-4121-f485-79fd01ad8dde"
114
+ },
115
+ "source" : [
116
+ " prod1"
117
+ ],
118
+ "execution_count" : 29 ,
119
+ "outputs" : [
120
+ {
121
+ "output_type" : " execute_result" ,
122
+ "data" : {
123
+ "text/plain" : [
124
+ " 0"
125
+ ]
126
+ },
127
+ "metadata" : {
128
+ "tags" : []
129
+ },
130
+ "execution_count" : 29
131
+ }
132
+ ]
133
+ },
134
+ {
135
+ "cell_type" : " code" ,
136
+ "metadata" : {
137
+ "colab" : {
138
+ "base_uri" : " https://localhost:8080/"
139
+ },
140
+ "id" : " 2JuT9WHBwRb2" ,
141
+ "outputId" : " a1cb17c0-68ea-48c4-dfea-a14ff1ed5617"
142
+ },
143
+ "source" : [
144
+ " prod2"
145
+ ],
146
+ "execution_count" : 30 ,
147
+ "outputs" : [
148
+ {
149
+ "output_type" : " execute_result" ,
150
+ "data" : {
151
+ "text/plain" : [
152
+ " 0"
153
+ ]
154
+ },
155
+ "metadata" : {
156
+ "tags" : []
157
+ },
158
+ "execution_count" : 30
159
+ }
160
+ ]
161
+ },
162
+ {
163
+ "cell_type" : " code" ,
164
+ "metadata" : {
165
+ "id" : " UbUCE8AFwSnw"
166
+ },
167
+ "source" : [
168
+ " "
169
+ ],
170
+ "execution_count" : null ,
171
+ "outputs" : []
172
+ }
173
+ ]
174
+ }
0 commit comments