diff --git a/s1_a53_6.py b/s1_a53_6.py index 10ec606..06a04ce 100644 --- a/s1_a53_6.py +++ b/s1_a53_6.py @@ -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!"}