generate functionThu, 02 Mar 2023

A natural number n is entered. Print the first natural number found (that is, iterate over numbers starting from 1) whose square is greater than n. Implement the program using a while loop.

def count_up(n): n = n + 1 count = 1 while n > count*count: count += 1 return count count_up(4)

Questions about programming?Chat with your personal AI assistant