ex00 ok
This commit is contained in:
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"editor.insertSpaces": true
|
||||||
|
}
|
||||||
@@ -6,3 +6,5 @@
|
|||||||
- [ ] Projet 2 data table : https://projects.intra.42.fr/projects/python-2-datatable
|
- [ ] Projet 2 data table : https://projects.intra.42.fr/projects/python-2-datatable
|
||||||
- [ ] Projet 3 oop : https://projects.intra.42.fr/projects/python-3-oop
|
- [ ] Projet 3 oop : https://projects.intra.42.fr/projects/python-3-oop
|
||||||
- [ ] Projet 4 dod : https://projects.intra.42.fr/projects/python-4-dod
|
- [ ] Projet 4 dod : https://projects.intra.42.fr/projects/python-4-dod
|
||||||
|
|
||||||
|
>> It is also a handy desk calculator (https://docs.python.org/3.10/tutorial/appetite.html)
|
||||||
23
d00/ex00/Hello.py
Normal file
23
d00/ex00/Hello.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
ft_list = ["Hello", "tata!"]
|
||||||
|
ft_tuple = ("Hello", "toto!")
|
||||||
|
ft_set = {"Hello", "tutu!"}
|
||||||
|
ft_dict = {"Hello" : "titi!"}
|
||||||
|
|
||||||
|
# ft_list
|
||||||
|
ft_list.append("World" + ft_list[1][-1])
|
||||||
|
ft_list.pop(1)
|
||||||
|
|
||||||
|
# ft_tuple
|
||||||
|
ft_tuple = ft_tuple[0], "France!"
|
||||||
|
|
||||||
|
# ft_set
|
||||||
|
# ft_set = "{'Hello', 'Paris!'}" # mouhaha
|
||||||
|
ft_set ^= {"tutu!", "Paris!"}
|
||||||
|
|
||||||
|
# ft_dict
|
||||||
|
ft_dict["Hello"] = "42Paris!"
|
||||||
|
|
||||||
|
print(ft_list)
|
||||||
|
print(ft_tuple)
|
||||||
|
print(ft_set)
|
||||||
|
print(ft_dict)
|
||||||
Reference in New Issue
Block a user