Ich arbeite seit ein paar Tagen daran. Ich habe mir mehrere Tutorials angesehen und in meinem Buch gelesen, ich bin neu in der Programmierung.Python Vielfache von 19
Ich erforderlich, um dieses Programm zu schreiben
Dieses Programm den Benutzer auffordern, sollte ein ganzzahliges Vielfaches von 19 zu gelangen, die größer ist als 200. Dann wird, sollte das Programm die Eingabe und Anzeige eine Antwort auf jede der Analyse vier mögliche Ergebnisse der Analyse. Siehe Beispielläufe unten.
Enter an exact multiple of 19 that is greater than 200 76
No, 76 is a multiple of 19 but it is not greater than 200
>>>
Enter an exact multiple of 19 that is greater than 200 55
55 is not over 200 and also is not a multiple of 19
>>>
Enter an exact multiple of 19 that is greater than 200 222
222 is over 200 but is not a multiple of 19
>>>
Enter an exact multiple of 19 that is greater than 200 380
Good input. 19 divides into 380 exactly 20 times
das ist, was ich
#promt user to enter an exact multiple of 19 that is larger than 200
#assign variable a to user input
def main() :
random = int(input('Enter an exact multiple of 19 that is greater than 200:'))
number = random/19
if random > 200 :
print('Good input 19 divides into', random , 'exactly' , number ,'times')
if random % 19 == 0 or random <200:
print('is a multiple of 19')
else:
print('is not a multiple of')
main()
bisher haben kann ich das Programm erhalten Sie die Zeile für den Benutzer 380 auszuspucken Eingabe aber ich bin ratlos, soweit wie die aufzuschreiben andere Ausgänge. Hilfe wäre toll !!!
Ah, der fizzbuzz Test ‚ole. (Dies sollte ausreichen, um es herauszufinden, ohne es auf einem Silbertablett zu übergeben) – Enfyve