10月 092020
 
#for循环
#用for循环打印出“Hello world”这段字符串中的每一个字符
#for关键词,every_letter可以容纳每一个元素的变量名称
for every_letter in 'Hello world':
    print(every_letter)
for number in '1 23 4 56 78 9':
    print(number)
PS D:\OneDrive\Python> & C:/Users/harveymei/AppData/Local/Programs/Python/Python39/python.exe d:/OneDrive/Python/hello.py
H
e
l
l
o

w
o
r
l
d
1

2
3

4

5
6

7
8

9
PS D:\OneDrive\Python> 

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据