About 3,370,000 results
Open links in new tab
  1. Get User Input in Loop using Python - GeeksforGeeks

    Apr 24, 2025 · When it comes to user input, these loops can be used to prompt the user for input and process the input based on certain conditions. In this article, we will explore how to use for and while loops for user input in Python.

  2. Python Program to Display the multiplication Table

    In the program below, we have used the for loop to display the multiplication table of 12. Source Code # Multiplication table (from 1 to 10) in Python num = 12 # To take input from the user # num = int(input("Display multiplication table of? ")) # Iterate 10 times from i = 1 to 10 for i in range(1, 11): print(num, 'x', i, '=', num*i) Output

  3. Multiplication Table Using While Loop in Python

    Mar 7, 2024 · In this article, we explored three different methods for creating multiplication tables using while loops in Python. The basic while loop, user-defined while loop, and nested while loop offer flexibility in generating tables for specific use cases.

  4. for loop - Creating a 'user input' based multiplication table in python ...

    Sep 30, 2020 · Simplest fix is to just add another input statement after your two print statements. In this code here, you get input, then start a loop. The input function is what gets user input, and you never get it again. You also have a logic error with your and s, they should be or s instead. print('Invalid number') Easiest fix:

  5. How to Take Multiple Inputs Using Loop in Python

    Feb 22, 2024 · Take Multiple Inputs Using Loop in Python. Below, are some of the ways to take multiple inputs In Python Using Loop: Using a List and For Loop; Using List Comprehension; Using While Loop; Take Multiple Inputs In Python Using a List and For Loop. In this example, below Python code takes a user-specified number of inputs, iterates through a for ...

  6. Write a program to print the table of a given number in Python - Code

    Oct 26, 2021 · To print the table of a given number first take an input integer number from the user in Python. Then we have iterated for loop using the range (1, 11) function . In the first iteration, the loop will iterate and multiply by 1 to the given number.

  7. Python program to print table of number entered by user

    Jan 13, 2024 · Run a loop in the range of 1 to 11 by using the range(1, 11) method. This method will return the values from 1 to 10. Multiply them by the number to print the table terms. Consider the below code: # Input a number n = int (input ("Enter The Number : ")) # Loop to print table for i in range (1, 11): t = n * i print (n, "x", i, "=", t)

  8. How to Take User Input with Loops in Python | Tutorial Reference

    This guide explores how to take user input within loops in Python, using both for and while loops. We'll cover how to: Collect a fixed number of inputs. Collect input until a condition is met. Validate user input (specifically for integers). Use list comprehensions. Use a for loop with range() when you know exactly how many inputs you need.

  9. Using a For or While Loop to take user input in Python

    To take user input in a while loop: Use a while loop to iterate until a condition is met. Use the input() function to take user input. If the condition is met, break out of the while loop.

  10. python - How do I use while loops to create a multiplication table ...

    Jul 5, 2018 · input any number to get your normal multiple table (Nomenclature) in 10 iterate times. Creating a multiplication table using while loop is shown below:

  11. Some results have been removed
Refresh