How to print odd and even numbers within 10 by python
This article will explain in detail how python prints odd and even numbers within 10. Xiaobian thinks it is quite practical, so share it with you for reference. I hope you can gain something after reading this article.
script content
#!/ usr/bin/env python
#-- coding: utf-8--
for i in range(1,10):
if i % 2 == 1:
print ('% d 'is an odd number. ' %(i))
else:
print ('% d 'is an even number. ' %(i) )
execute scripts
About "python how to print odd and even numbers within 10" this article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.