commited all contents created by participants
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
h1. Le nom de mon projet
|
||||
|
||||
h2. Monprenom Monnom
|
||||
|
||||
à partir d'ici vous pouvez écrire le texte de description de votre projet
|
||||
|
||||
!images/tutorial-getting-started-krita_part1_14_net.jpg!
|
||||
|
||||
Pour insérer des images, comme des shoot écrans de votre travail, commencez par les déposer dans le dossier images de votre dossier perso
|
||||
puis ajouter cette ligne:
|
||||
|
||||
bc. !images/nomdemonimage.jpeg!
|
||||
|
||||
Toutes les images seront insérez automatiquement a la fin de votre description dans la documentation finale, sauf celle ajouté manuellement dans le texte.
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/python
|
||||
#-*- coding: utf-8 -*-
|
||||
# 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 l'économie 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:", " ".join(words).capitalize()+'.')
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/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 reverse mode
|
||||
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
|
||||
'''
|
||||
|
||||
# Run script in loop:
|
||||
while True:
|
||||
|
||||
# Ask to write a sentence
|
||||
sentence = input("Ecrivez votre phrase: ").lower().strip('\., \?')
|
||||
|
||||
# Split sentence into words
|
||||
words = sentence.split()
|
||||
#print(words)
|
||||
|
||||
# if sentence is only 1 word, reverse word
|
||||
if len(words) < 2:
|
||||
for word in words:
|
||||
word = word[::-1]
|
||||
print(word.capitalize())
|
||||
# if sentence is more than 1 word
|
||||
else:
|
||||
words.reverse()
|
||||
print(" ".join(words).capitalize(), '.')
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# déclarer les variables
|
||||
lettre1="o"
|
||||
lettre2="l"
|
||||
lettre3="a"
|
||||
# imprimer les variables
|
||||
print(lettre1+lettre2+lettre3)
|
||||
# print(lettre1+lettre2+lettre3)
|
||||
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env python
|
||||
# encoding=utf8
|
||||
|
||||
# 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 vie rose..."
|
||||
# Print sentence
|
||||
print(sentence)
|
||||
tri=sentence.count("vie")
|
||||
print(tri)
|
||||
|
||||
# # define new word as list
|
||||
# new_word = []
|
||||
|
||||
# Convert sentence in list of words
|
||||
#words = sentence.split(separateur)
|
||||
# print(words)
|
||||
# # For each word in word list
|
||||
# for word in words:
|
||||
# # remove capital letters (string operation)
|
||||
# word = word.lower()
|
||||
# # Clean punctuation (string operation)
|
||||
# word = word.strip(" ;''?:,()!.\").”-")
|
||||
# # add word to new word list
|
||||
# new_word.append(word)
|
||||
|
||||
# Write words as one, without punctuation
|
||||
#print("phrase mise en mots:", ''.join(new_word))
|
||||
@@ -0,0 +1,4 @@
|
||||
phrase originale: Les gouvernements suspectent l'économie parce qu’elle est une force qui leur échappe
|
||||
['les', 'gouvernements', 'suspectent', "l'économie", 'parce', 'qu’elle', 'est', 'une', 'force', 'qui', 'leur', 'échappe']
|
||||
['est', 'force', 'gouvernements', "l'économie", 'les', 'leur', 'parce', 'qui', 'qu’elle', 'suspectent', 'une', 'échappe']
|
||||
phrase alphabétique: Est force gouvernements l'économie les leur parce qui qu’elle suspectent une échappe.
|
||||
Reference in New Issue
Block a user