Write a Python program to print the square of first 10 natural numbers, using while loop

Question

Write a Python program to print the square of first 10 natural numbers, using while loop
🧐 Not the exact question you are looking for?Go ask a question

Solution 1

Sure, here is a simple Python program that prints the square of the first 10 natural numbers using a while loop:

# Initialize the counter
counter = 1

# Use a while loop to iterate over the first 10 natural numbers
while counter <= 10:
    # Calculate the square of the current number
    
    Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study prob
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solv

This problem has been solved

Similar Questions

Write a Python program to print the square of first 10 natural numbers, using while loop

Write a Python program using a while loop to calculate and display the factorial of a user-inputnumber. Ensure your program handles invalid inputs gracefully.

create a C program to print Fibonacci series upto a specified number N using while loop.

write a program to print integer no, from 1 to n where n is the input from the user using do while loop in c language use getch

Write a program to enter two numbers and print the arithmeticoperations like +,-,*,**, /, // and % using function

1/3