Here's the Python code to print the numbers 1 to 100:

for i in range(1, 101):
    print(i)

This code uses a 'for' loop to iterate over a range of numbers from 1 to 100 (inclusive). The 'range' function generates a sequence of numbers, starting from the first argument (1 in this case) and stopping before the second argument (101 in this case). The loop then prints each number in the sequence using the 'print' function.

Python Code to Print Numbers 1 to 100

原文地址: https://www.cveoy.top/t/topic/lEA9 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录