Aufgabe 3 optimiert
parent
03a0c352ae
commit
808aeba78f
|
@ -1,11 +1,9 @@
|
|||
if __name__ == "__main__":
|
||||
# Aufgabe 3
|
||||
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
||||
for i in range(0, 3):
|
||||
numbers.insert(0, numbers.pop())
|
||||
numbers = numbers[-3:] + numbers[:-3]
|
||||
print(numbers)
|
||||
|
||||
|
||||
# Aufgabe 4
|
||||
def split_chars_and_remove_duplicates(word: str):
|
||||
string_list = list(word)
|
||||
|
@ -31,7 +29,6 @@ if __name__ == "__main__":
|
|||
|
||||
print("The sorted list " + str(list_to_sort))
|
||||
|
||||
|
||||
# Aufgabe 6
|
||||
def get_the_animal_sound(name_of_animal: str):
|
||||
animal_dictionary = {"Lion": "Growl!", "Dog": "Barks!", "Cat": "Meow!"}
|
||||
|
|
Loading…
Reference in New Issue