mirror of
https://git.erg.school/P039/art_num_2024.git
synced 2026-02-04 04:59:18 +01:00
art python intro
This commit is contained in:
16
python/introduction/README.md
Normal file
16
python/introduction/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
## introduction
|
||||
```
|
||||
variables
|
||||
list --> bisous.py programming.py
|
||||
input --> bisous.py
|
||||
print
|
||||
for loop --> bisous.py
|
||||
conditional statements if/else/elif --> bisous.py
|
||||
break --> bisous.py
|
||||
while loop --> missing.py
|
||||
dictionary
|
||||
enumerate
|
||||
return --> missing.py
|
||||
random --> programming.py
|
||||
function --> missing.py
|
||||
```
|
||||
19
python/introduction/bisous.py
Normal file
19
python/introduction/bisous.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Initialiser les variables
|
||||
queer = "mon amour"
|
||||
bisous = ["ma biche", "mom bébé", "mon amour", "mon chéri.e"]
|
||||
|
||||
# Demander une saisie à l'utilisateur
|
||||
amoureuxse = input("Entrez le nom de votre bien-aiméx : ")
|
||||
|
||||
# Boucler à travers la liste et imprimer le message correspondant
|
||||
for bisou in bisous:
|
||||
if bisou == queer:
|
||||
print("bisou pour toi", bisou, amoureuxse)
|
||||
|
||||
elif amoureuxse == "python":
|
||||
print("on dirait un.e geek")
|
||||
break
|
||||
|
||||
else:
|
||||
print(f":* :* {bisou}, {amoureuxse}")
|
||||
|
||||
12
python/introduction/missing.py
Normal file
12
python/introduction/missing.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from time import sleep
|
||||
|
||||
love = True
|
||||
how = "so"
|
||||
|
||||
def missing(so):
|
||||
print(f"I miss you {so} much")
|
||||
|
||||
while love:
|
||||
missing(how)
|
||||
how += " so"
|
||||
sleep(0.2)
|
||||
25
python/introduction/programming.py
Normal file
25
python/introduction/programming.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""
|
||||
poem converted from bash programming.sh by Winnie Soon, modified from The House of Dust, 1967 Alison Knowles and James Tenney
|
||||
"""
|
||||
import random
|
||||
import time
|
||||
|
||||
# listes for different elements
|
||||
kisses = ["DEAREST", "SWEETHEART", "WORLD", "DARLING", "BABY", "LOVE", "MONKEY", "SUGAR", "LITTLE PRINCE"]
|
||||
material = ["SAND", "DUST", "LEAVES", "PAPER", "TIN", "ROOTS", "BRICK", "STONE", "DISCARDED CLOTHING", "GLASS", "STEEL", "PLASTIC", "MUD", "BROKEN DISHES", "WOOD", "STRAW", "WEEDS", "FOREST"]
|
||||
location = ["IN A GREEN, MOSSY TERRAIN", "IN AN OVERPOPULATED AREA", "BY THE SEA", "BY AN ABANDONED LAKE", "IN A DESERTED FACTORY", "IN DENSE WOODS", "IN JAPAN", "AMONG SMALL HILLS", "IN SOUTHERN FRANCE", "AMONG HIGH MOUNTAINS", "ON AN ISLAND", "IN A COLD, WINDY CLIMATE", "IN A PLACE WITH BOTH HEAVY RAIN AND BRIGHT SUN", "IN A DESERTED AIRPORT", "IN A HOT CLIMATE", "INSIDE A MOUNTAIN", "ON THE SEA", "IN MICHIGAN", "IN HEAVY JUNGLE UNDERGROWTH", "BY A RIVER", "AMONG OTHER HOUSES", "IN A DESERTED CHURCH", "IN A METROPOLIS", "UNDERWATER", "ON THE SCREEN", "ON THE ROAD"]
|
||||
light_source = ["CANDLES", "ALL AVAILABLE LIGHTING", "ELECTRICITY", "NATURAL LIGHT", "LEDS", "MOON LIGHT", "THE SMALL TORCH"]
|
||||
inhabitants = ["PEOPLE WHO SLEEP VERY LITTLE", "VEGETARIANS", "HORSES AND BIRDS", "PEOPLE SPEAKING MANY LANGUAGES WEARING LITTLE OR NO CLOTHING", "CHILDREN AND OLD PEOPLE", "VARIOUS BIRDS AND FISH", "LOVERS", "PEOPLE WHO ENJOY EATING TOGETHER", "PEOPLE WHO EAT A GREAT DEAL", "COLLECTORS OF ALL TYPES", "FRIENDS AND ENEMIES", "PEOPLE WHO SLEEP ALMOST ALL THE TIME", "VERY TALL PEOPLE", "AMERICAN INDIANS", "LITTLE BOYS", "PEOPLE FROM MANY WALKS OF LIFE", "FRIENDS", "FRENCH AND GERMAN SPEAKING PEOPLE", "FISHERMEN AND FAMILIES", "PEOPLE WHO LOVE TO READ", "CHEERFUL KIDS", "QUEER LOVERS", "NAUGHTY MONKEYS", "KIDDOS"]
|
||||
|
||||
# Infinite loop
|
||||
while True:
|
||||
print("HELLO", random.choice(kisses))
|
||||
print(" A TERMINAL OF BLACK", random.choice(material))
|
||||
print(" ", random.choice(location))
|
||||
print(" PROGRAMMING", random.choice(light_source))
|
||||
print(" KISSED BY", random.choice(inhabitants))
|
||||
print(" ")
|
||||
|
||||
# Delay for 3.5 seconds
|
||||
time.sleep(3.5)
|
||||
|
||||
Reference in New Issue
Block a user