commited all contents created by participants

This commit is contained in:
Bachir Soussi Chiadmi
2017-12-21 18:12:40 +01:00
parent cefd1c2ad0
commit b936b1e616
2137 changed files with 1076319 additions and 730 deletions
@@ -0,0 +1,25 @@
#!/usr/bin/python
# this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
'''
This script takes a sentence you write in the terminal, and gives it back in alphabetical order
A list is ordered and changeable. It is less efficient than a set/tuple. But it allows to work with index numbers.
Check out other options for list comprehension: https://docs.python.org/3/tutorial/datastructures.html
Made for OLA #5, Paris, 15-17 décembre 2017
'''
# Ask to write a sentence
sentence = "Les gouvernements suspectent la littérature parce qu’elle est une force qui leur échappe"
# print sentence
print("phrase originale:", sentence)
# Split sentence into words
words = sentence.lower().split()
print(words)
# sort words of list
words.sort()
print(words)
# print sorted wordlist as string
print("phrase alphabétique finale:", "+".join(words).capitalize()+'.')
@@ -0,0 +1,25 @@
#!/usr/bin/python
# this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
'''
This script takes a sentence you write in the terminal, and gives it back in alphabetical order
A list is ordered and changeable. It is less efficient than a set/tuple. But it allows to work with index numbers.
Check out other options for list comprehension: https://docs.python.org/3/tutorial/datastructures.html
Made for OLA #5, Paris, 15-17 décembre 2017
'''
# Ask to write a sentence
sentence = "Les gouvernements suspectent la littérature parce qu’elle est une force qui leur échappe"
# print sentence
print("phrase originale:", sentence)
# Split sentence into words
words = sentence.lower().split()
print(words)
# sort words of list
words.sort()
print(words)
# print sorted wordlist as string
print("phrase dans l'ordre alphabétique:", "+".join(words).capitalize()+'.')
@@ -0,0 +1,25 @@
#!/usr/bin/python
# this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
'''
This script takes a sentence you write in the terminal, and gives it back in alphabetical order
A list is ordered and changeable. It is less efficient than a set/tuple. But it allows to work with index numbers.
Check out other options for list comprehension: https://docs.python.org/3/tutorial/datastructures.html
Made for OLA #5, Paris, 15-17 décembre 2017
'''
# Ask to write a sentence
sentence = "Les gouvernements suspectent la littérature parce qu’elle est une force qui leur échappe"
# print sentence
print("phrase originale:", sentence)
# Split sentence into words
words = sentence.lower().split()
print(words)
# sort words of list
#words.sort()
#print(words)
# print sorted wordlist as string
#print("phrase dans l'ordre alphabétique:", "+".join(words).capitalize()+'.')
@@ -0,0 +1,47 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Constant, Algolit
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
# Reduction of letters
# From string to list & back
# A string: a list of characters, unchangeable, but treatable
# See: https://www.tutorialspoint.com/python3/python_strings.htm
# Write sentence as string
sentence = "Je vois La Vie en rose..."
# Print sentence
print("phrase originale:", sentence)
# define new word as list
new_word = []
# Convert sentence in list of words
words = sentence.split(" ")
print(words)
# For each word in word list
for word in words:
print("word:",word)
# remove capital letters (string operation)
word = word.lower()
print("word tout en bas de casse:", word)
# Clean punctuation (string operation)
word = word.strip(" ;''?:,()!.\").”-")
print("word sans ponctuation:", word)
# add word to new word list
new_word.append(word)
print("new_word:",new_word)
# Write words as one, without punctuation
print("phrase mise en mots:", " ".join(new_word).capitalize()+".")
@@ -0,0 +1,49 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Constant, Algolit
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
# Reduction of letters
# From string to list & back
# A string: a list of characters, unchangeable, but treatable
# See: https://www.tutorialspoint.com/python3/python_strings.htm
# Write sentence as string
sentence = "Je vois La Vie en rose..."
# Print sentence
print("phrase originale:", sentence)
#affiche le premier caractère de sentence
print(sentence[-1])
# define new word as list
#new_word = []
# Convert sentence in list of words
#words = sentence.split(" ")
#print(words)
# For each word in word list
#for word in words:
#print("word:",word)
# remove capital letters (string operation)
#word = word.lower()
#print("word tout en bas de casse:", word)
# Clean punctuation (string operation)
#word = word.strip(" ;''?:,()!.\").”-")
#print("word sans ponctuation:", word)
# add word to new word list
#new_word.append(word)
#print("new_word:",new_word)
# Write words as one, without punctuation
#print("phrase mise en mots:", " ".join(new_word).capitalize()+".")
@@ -0,0 +1,49 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Constant, Algolit
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
# Reduction of letters
# From string to list & back
# A string: a list of characters, unchangeable, but treatable
# See: https://www.tutorialspoint.com/python3/python_strings.htm
# Write sentence as string
sentence = "Je vois La Vie en rose..."
# Print sentence
print("phrase originale:", sentence)
#affiche des caractères à certaines positions de sentence
print(sentence[0:3])
# define new word as list
#new_word = []
# Convert sentence in list of words
#words = sentence.split(" ")
#print(words)
# For each word in word list
#for word in words:
#print("word:",word)
# remove capital letters (string operation)
#word = word.lower()
#print("word tout en bas de casse:", word)
# Clean punctuation (string operation)
#word = word.strip(" ;''?:,()!.\").”-")
#print("word sans ponctuation:", word)
# add word to new word list
#new_word.append(word)
#print("new_word:",new_word)
# Write words as one, without punctuation
#print("phrase mise en mots:", " ".join(new_word).capitalize()+".")
@@ -0,0 +1,51 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Constant, Algolit
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
# Reduction of letters
# From string to list & back
# A string: a list of characters, unchangeable, but treatable
# See: https://www.tutorialspoint.com/python3/python_strings.htm
# Write sentence as string
sentence = "Je vois La Vie en rose..."
# Print sentence
print("phrase originale:", sentence)
#remplace les lettres e par ?
string.replace("e","?")
# define new word as list
#new_word = []
# Convert sentence in list of words
#words = sentence.split(" ")
#print(words)
# For each word in word list
#for word in words:
#print("word:",word)
# remove capital letters (string operation)
#word = word.lower()
#print("word tout en bas de casse:", word)
# Clean punctuation (string operation)
#word = word.strip(" ;''?:,()!.\").”-")
#print("word sans ponctuation:", word)
# add word to new word list
#new_word.append(word)
#print("new_word:",new_word)
# Write words as one, without punctuation
#print("phrase mise en mots:", " ".join(new_word).capitalize()+".")
@@ -0,0 +1,52 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Constant, Algolit
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
# Reduction of letters
# From string to list & back
# A string: a list of characters, unchangeable, but treatable
# See: https://www.tutorialspoint.com/python3/python_strings.htm
# Write sentence as string
sentence = "Je vois La Vie en rose..."
# Print sentence
print("phrase originale:", sentence)
#remplace les lettres e par ?
sentence.replace("e","?")
print(sentence)
# define new word as list
#new_word = []
# Convert sentence in list of words
#words = sentence.split(" ")
#print(words)
# For each word in word list
#for word in words:
#print("word:",word)
# remove capital letters (string operation)
#word = word.lower()
#print("word tout en bas de casse:", word)
# Clean punctuation (string operation)
#word = word.strip(" ;''?:,()!.\").”-")
#print("word sans ponctuation:", word)
# add word to new word list
#new_word.append(word)
#print("new_word:",new_word)
# Write words as one, without punctuation
#print("phrase mise en mots:", " ".join(new_word).capitalize()+".")
@@ -0,0 +1,52 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Constant, Algolit
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
# Reduction of letters
# From string to list & back
# A string: a list of characters, unchangeable, but treatable
# See: https://www.tutorialspoint.com/python3/python_strings.htm
# Write sentence as string
sentence = "Je vois La Vie en rose..."
# Print sentence
print("phrase originale:", sentence)
#remplace les lettres e par rien
sentence.replace("e","")
print(sentence)
# define new word as list
#new_word = []
# Convert sentence in list of words
#words = sentence.split(" ")
#print(words)
# For each word in word list
#for word in words:
#print("word:",word)
# remove capital letters (string operation)
#word = word.lower()
#print("word tout en bas de casse:", word)
# Clean punctuation (string operation)
#word = word.strip(" ;''?:,()!.\").”-")
#print("word sans ponctuation:", word)
# add word to new word list
#new_word.append(word)
#print("new_word:",new_word)
# Write words as one, without punctuation
#print("phrase mise en mots:", " ".join(new_word).capitalize()+".")
@@ -0,0 +1,52 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Constant, Algolit
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
# Reduction of letters
# From string to list & back
# A string: a list of characters, unchangeable, but treatable
# See: https://www.tutorialspoint.com/python3/python_strings.htm
# Write sentence as string
sentence = "Je vois La Vie en rose..."
# Print sentence
print("phrase originale:", sentence)
#remplace les lettres e par rien
sentence.replace("J","")
print(sentence)
# define new word as list
#new_word = []
# Convert sentence in list of words
#words = sentence.split(" ")
#print(words)
# For each word in word list
#for word in words:
#print("word:",word)
# remove capital letters (string operation)
#word = word.lower()
#print("word tout en bas de casse:", word)
# Clean punctuation (string operation)
#word = word.strip(" ;''?:,()!.\").”-")
#print("word sans ponctuation:", word)
# add word to new word list
#new_word.append(word)
#print("new_word:",new_word)
# Write words as one, without punctuation
#print("phrase mise en mots:", " ".join(new_word).capitalize()+".")
@@ -0,0 +1,52 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Constant, Algolit
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
# Reduction of letters
# From string to list & back
# A string: a list of characters, unchangeable, but treatable
# See: https://www.tutorialspoint.com/python3/python_strings.htm
# Write sentence as string
string = "Je vois La Vie en rose..."
# Print sentence
print("phrase originale:", string)
#remplace les lettres e par rien
string.replace("J","")
print(sentence)
# define new word as list
#new_word = []
# Convert sentence in list of words
#words = sentence.split(" ")
#print(words)
# For each word in word list
#for word in words:
#print("word:",word)
# remove capital letters (string operation)
#word = word.lower()
#print("word tout en bas de casse:", word)
# Clean punctuation (string operation)
#word = word.strip(" ;''?:,()!.\").”-")
#print("word sans ponctuation:", word)
# add word to new word list
#new_word.append(word)
#print("new_word:",new_word)
# Write words as one, without punctuation
#print("phrase mise en mots:", " ".join(new_word).capitalize()+".")
@@ -0,0 +1,52 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Constant, Algolit
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
# Reduction of letters
# From string to list & back
# A string: a list of characters, unchangeable, but treatable
# See: https://www.tutorialspoint.com/python3/python_strings.htm
# Write sentence as string
string = "Je vois La Vie en rose..."
# Print sentence
print("phrase originale:", string)
#remplace les lettres e par rien
string.replace("J","")
print(string)
# define new word as list
#new_word = []
# Convert sentence in list of words
#words = sentence.split(" ")
#print(words)
# For each word in word list
#for word in words:
#print("word:",word)
# remove capital letters (string operation)
#word = word.lower()
#print("word tout en bas de casse:", word)
# Clean punctuation (string operation)
#word = word.strip(" ;''?:,()!.\").”-")
#print("word sans ponctuation:", word)
# add word to new word list
#new_word.append(word)
#print("new_word:",new_word)
# Write words as one, without punctuation
#print("phrase mise en mots:", " ".join(new_word).capitalize()+".")
@@ -0,0 +1,48 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Constant, Algolit
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
# Reduction of letters
# From string to list & back
# A string: a list of characters, unchangeable, but treatable
# See: https://www.tutorialspoint.com/python3/python_strings.htm
# Write sentence as string
sentence = "Je vois La Vie en rose..."
# Print sentence
print("phrase originale:", sentence)
#affiche des caractè
# define new word as list
#new_word = []
# Convert sentence in list of words
#words = sentence.split(" ")
#print(words)
# For each word in word list
#for word in words:
#print("word:",word)
# remove capital letters (string operation)
#word = word.lower()
#print("word tout en bas de casse:", word)
# Clean punctuation (string operation)
#word = word.strip(" ;''?:,()!.\").”-")
#print("word sans ponctuation:", word)
# add word to new word list
#new_word.append(word)
#print("new_word:",new_word)
# Write words as one, without punctuation
#print("phrase mise en mots:", " ".join(new_word).capitalize()+".")