Add files via upload
This commit is contained in:
parent
18cf473060
commit
fa1d1dc4c7
17
ENSIM/Functions.py
Normal file
17
ENSIM/Functions.py
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
n = 0
|
||||
|
||||
def setup():
|
||||
global n
|
||||
n = 100
|
||||
|
||||
def loop():
|
||||
global n
|
||||
n = n + 1
|
||||
if((n % 2) == 0):
|
||||
print(n)
|
||||
|
||||
setup()
|
||||
while True:
|
||||
loop()
|
3
ENSIM/HelloWorld.py
Normal file
3
ENSIM/HelloWorld.py
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
print "Hello, world !";
|
20
ENSIM/Premiers.py
Normal file
20
ENSIM/Premiers.py
Normal file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/python
|
||||
import math #Importer le module math pour la racine carree
|
||||
|
||||
#value = input("Jusqu'a quel nombre voulez-vous chercher un nombre premier ?")
|
||||
|
||||
value = 100000
|
||||
|
||||
tab = range(0, value)
|
||||
|
||||
for i in range(2, int(math.ceil(math.sqrt(value)))):
|
||||
if tab[i] != -1:
|
||||
for j in range(i+1, value):
|
||||
if tab[j] > 1:
|
||||
#print tab[i] % tab[j]
|
||||
if tab[j] % tab[i] == 0:
|
||||
tab[j] = -1
|
||||
|
||||
for i in range(0, value):
|
||||
if tab[i] != -1:
|
||||
print tab[i]
|
Loading…
Reference in New Issue
Block a user