Get the App
SLTechnology News&Howtos  ›  Development  › 

How to print odd and even numbers within 10 by python

Shulou Source: shulou.com Published: 2022-06-03 04:31:37 10月03日 Update

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.

Tags: Even odd articles content more scripts good practical articles knowledge references help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Redmi Shulou Information MariaDB Microsoft