摘要:
#!/usr/bin/python #coding=utf-8 #好好学习,天天向上 numbers=list(range(1,6)) print(numbers) range指定步长: #!/usr/bin/python #coding=utf-8 #好好学习,天天向上 numbers=list( 阅读全文
摘要:
#!/usr/bin/python #coding=utf-8 #好好学习,天天向上 for value in range(1,6): print(value) 阅读全文
摘要:
1.python会根据缩进来判断代码行和前一句代码行之间的关系 2.for循环后一定要缩进,for循环后面的冒号代表告诉python,下面是代码行缩进的第一行 阅读全文
摘要:
#!/usr/bin/python #coding=utf-8 #好好学习,天天向上 magicians=['alice','david','candy'] for magician in magicians: print(f"{magicians},that was a great trick!" 阅读全文