Teil 6 "Objekte ist neu

Repository aufgeräumt.
This commit is contained in:
2023-02-24 06:41:05 +01:00
parent c21159f36f
commit 3d8cb9128d
34 changed files with 196 additions and 0 deletions

7
teil5/lists/append.py Normal file
View File

@@ -0,0 +1,7 @@
namen = ["Homer", "Marge", "Bart"]
namen.append('Lisa')
namen.append('Maggie')
print(namen)

9
teil5/lists/del.py Normal file
View File

@@ -0,0 +1,9 @@
zahlen1 = ['0','1','4','3','2','5']
zahlen2 = ['8','7','9','6']
zahlen1.extend(zahlen2)
print(f'komplett:{zahlen1}')
zahlen1.sort()
del zahlen1[3]
print(f'nach del:{zahlen1}')

6
teil5/lists/extend.py Normal file
View File

@@ -0,0 +1,6 @@
zahlen1 = ['0','1','2','3','4','5']
zahlen2 = ['6','7','8','9']
zahlen1.extend(zahlen2)
print(zahlen1)

View File

@@ -0,0 +1,4 @@
namen = ["Homer", "Marge", "Bart"]
for ind in range(0,len(namen)):
print(f'{ind}: {namen[ind]}')

5
teil5/lists/namen.py Normal file
View File

@@ -0,0 +1,5 @@
namen = ["Homer", "Marge", "Bart"]
print(namen[0])
print(namen[1])
print(namen[2])

8
teil5/lists/sort.py Normal file
View File

@@ -0,0 +1,8 @@
zahlen1 = ['0','1','4','3','2','5']
zahlen2 = ['8','7','9','6']
zahlen1.extend(zahlen2)
print(f'unsortiert:{zahlen1}')
zahlen1.sort()
print(f'sortiert:{zahlen1}')