print first n even numbers in python
Answers
Answered by
2
Explanation:
print num; In the above example, we have given n*2 as stop, the reason being, if you are to display n even numbers, in the range of 1 to n you will only have n/2 even numbers, and for printing n even numbers you need to double the range, which results in getting the desired number of even numbers i.e. n even numbers.
Answered by
1
We can do it simply with the (start,stop,step) command with it in the attachment please.
note: n is the number of output you will have, you can change the number of n acc. to you!
Attachments:
Similar questions
Hindi,
28 days ago
CBSE BOARD X,
28 days ago
Math,
28 days ago
English,
1 month ago
History,
9 months ago
Social Sciences,
9 months ago
Math,
9 months ago