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
Math,
1 month ago
Computer Science,
1 month ago
Biology,
1 month ago
English,
3 months ago
Math,
3 months ago
History,
10 months ago
Social Sciences,
10 months ago
Math,
10 months ago