# -*- coding: utf-8 -*- #Aufabe 2 number1 = int(input("Bitte Zahl eingeben\n")) number2 = int(input("Bitte Zahl eingeben\n")) print("Sum= ", number1 + number2) #Aufabe 3 input1 = input("Bitte Zahl eingeben\n") input2 = input("Bitte Zahl eingeben\n") input3 = input("Bitte Zahl eingeben\n") input4 = input("Bitte Zahl eingeben\n") number1 = float(input1) number2 = float(input2) number3 = float(input3) number4 = float(input4) sum = number1 + number2 + number3 + number4 meanValue = sum / 4 print("Mean value = ", round(meanValue, 2)) #Aufgabe 4 mwst = 7.7 price = input("Bitte Preis eingeben\n") priceWOmwst = float(price) priceWmwst = priceWOmwst * (100 + mwst) / 100 print("End price = ", priceWmwst) #Aufabe 5 price = input("Bitte Preis eingeben\n") priceWOdiscount = float(price) discountInput = input("Bitte Rabatt eingeben\n") discount = int(discountInput) if discount < 0 or discount >= 100 or priceWOdiscount < 0: print("Der Rabatt oder der Preis ist inkorrekt!") else: priceWdiscount = priceWOdiscount * (100 - discount) / 100 print("Preis mit Rabatt = ", priceWdiscount) #Aufgabe 7 input1 = input("Bitte 1.Preis eingeben\n") price1 = float(input1) input2 = input("Bitte 2.Preis eingeben\n") price2 = float(input2) input3 = input("Bitte 3.Preis eingeben\n") price3 = float(input3) betragEingabe = input("Bitte bezahlten Betrag eingeben\n") amount = float(betragEingabe) totalprice = price1 + price2 + price3 difference = amount - totalprice if difference >= 0: print("Rueckgeld = ", round(difference ,2)) else: print("Bitte fehlenden Betrag nachzahlen: ", -difference) #Aufgabe 8 balanceInput = input("Bitte Kontostand eingeben\n") interestInput = input("Bitte Zins eingeben\n") interest = float(interestInput) balance = float(balanceInput) balance12 = balance * (100 + interest) / 100 print("Nach 1 Jahr = ", balance12) balance24 = balance12 * (100 + interest) / 100 print("Nach 2 Jahren = ", balance24) balance36 = balance24 * (100 + interest) / 100 print("Nach 3 Jahren = ", balance36) #Aufgabe 11 word = input("Bitte Wort mit vier Buchstaben eingeben\n") if len(word) == 4: reversed = word[3] + word[2] + word[1] + word[0] print(reversed) else: print("Falsche Eingabe!") #Aufgabe 12 word = input("Bitte Wort eingeben\n") wordLength = len(word) + 1 # Korrektur bei ungerader Anzahl Buchstaben halfLength = int(wordLength / 2) part1 = word[0:halfLength] part2 = word[halfLength:wordLength] print(part1 + "-" + part2) #Aufgabe 13 word = input("Bitte Wort eingeben\n") part1 = word[0:4] longWord = word + part1 print(longWord)