Class 11 Exam  >  Class 11 Questions  >  Write a python program to input a number and ... Start Learning for Free
Write a python program to input a number and print its five first multiples?
Most Upvoted Answer
Write a python program to input a number and print its five first mult...
Python Program to Print Five First Multiples of a Number

To print the five first multiples of a number in Python, we need to take the input from the user and then calculate the multiples using a loop. The loop will run five times and print the result each time.

Steps to Write the Program:

1. Take input from the user using the input() function and store it in a variable.
2. Convert the input to an integer using the int() function.
3. Initialize a variable to store the result of each multiple.
4. Use a for loop to calculate the five first multiples of the input number.
5. Print the result of each multiple.

Python Code:

```
num = int(input("Enter a number: "))
result = 0

for i in range(1, 6):
result = num * i
print(num, "x", i, "=", result)
```

Explanation:

The program starts by taking input from the user using the input() function and storing it in the variable "num". We then convert the input to an integer using the int() function.

Next, we initialize a variable "result" to store the result of each multiple. We use a for loop to calculate the five first multiples of the input number. The loop runs from 1 to 5, and each time it calculates the multiple by multiplying the input number with the loop variable "i". The result is stored in the "result" variable.

Finally, we use the print() function to print the result of each multiple. We print the input number, the loop variable "i", and the result of the multiplication using the string concatenation operator "+".

This program will take the input number from the user and print its five first multiples.
Community Answer
Write a python program to input a number and print its five first mult...
N= int(input("enter number:"))
for a in range(1,6):
print(n*a)

Please check that you use the print statement in correct indentation. It will be placed below 'a'
Attention Class 11 Students!
To make sure you are not studying endlessly, EduRev has designed Class 11 study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Class 11.
Explore Courses for Class 11 exam

Top Courses for Class 11

Write a python program to input a number and print its five first multiples?
Question Description
Write a python program to input a number and print its five first multiples? for Class 11 2024 is part of Class 11 preparation. The Question and answers have been prepared according to the Class 11 exam syllabus. Information about Write a python program to input a number and print its five first multiples? covers all topics & solutions for Class 11 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Write a python program to input a number and print its five first multiples?.
Solutions for Write a python program to input a number and print its five first multiples? in English & in Hindi are available as part of our courses for Class 11. Download more important topics, notes, lectures and mock test series for Class 11 Exam by signing up for free.
Here you can find the meaning of Write a python program to input a number and print its five first multiples? defined & explained in the simplest way possible. Besides giving the explanation of Write a python program to input a number and print its five first multiples?, a detailed solution for Write a python program to input a number and print its five first multiples? has been provided alongside types of Write a python program to input a number and print its five first multiples? theory, EduRev gives you an ample number of questions to practice Write a python program to input a number and print its five first multiples? tests, examples and also practice Class 11 tests.
Explore Courses for Class 11 exam

Top Courses for Class 11

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev