|
Server IP : 10.128.40.6 / Your IP : 216.73.217.20 Web Server : Apache System : Linux webd006.cluster128.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : logmcpe ( 111175) PHP Version : 7.3.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/logmcpe/www/TEST/www/../../TMCPRO/pages/python/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 18 23:22:08 2022
@author: pro
"""
my_liste = ["yassine","imane","kamal","ismail"]
diction = {k:v for k,v in enumerate(my_liste)}
print(diction)
liste_age = [10,20,26,15]
dictionnaire_2 ={prenom: age for prenom,age in zip(my_liste, liste_age)}
print(dictionnaire_2)
# technique trés utils: ajouter une condition
dictionnare2 = { nom : age for nom , age in zip(my_liste,liste_age) if age >20}
print(dictionnare2)
# créer un tuple COMPREHENSION
tuple1 = tuple(i**2 for i in range(10))
print(tuple1)