generate functionThu, 02 Mar 2023

A natural number n is entered (that is, a positive integer). Loop through all integers in the interval [1; n] and form a list of multiples of 3 and 5 at the same time. Output the resulting sequence of numbers as a space-separated string if the value of n is less than 100. Otherwise, display the message "n is too large" (without quotes). Use an else statement in the program after the while lo

def mult35(n): if n >= 100: print("n is too large") elif n < 100: i = 1 while i <= n: if i % 3 == 0 and i % 5 == 0: print(i, end=" ") i += 1

Questions about programming?Chat with your personal AI assistant