Skip to content
Snippets Groups Projects
Commit fc63d289 authored by KimMinSeob's avatar KimMinSeob
Browse files

Upload New File

parent b0bde33a
No related branches found
No related tags found
No related merge requests found
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 03:13:28)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license()" for more information.
>>>
========= RESTART: /Users/kimminsub/Desktop/창소입/python/while.py =========
how many recursive?
6
1time recursive.
2time recursive.
3time recursive.
4time recursive.
5time recursive.
6time recursive.
recursive is end
>>>
========= RESTART: /Users/kimminsub/Desktop/창소입/python/while.py =========
do you want recursive? [yes/no]:
yes
recursive
do you want recursive? [yes/no]:
yes
recursive
do you want recursive? [yes/no]:
no
>>> for i in(1,2,3):
print(i)
1
2
3
>>> for s in ['brain','attack','python']
SyntaxError: invalid syntax
>>> for s in ['brain','attack','python']:
print(s)
brain
attack
python
>>> #range 함수
>>> for i in range(0,5,1):
print(i)
0
1
2
3
4
>>> for i in range(0,10,2):
print(i)
0
2
4
6
8
>>> #for i in range(x,y,z): >>> x는 시작갑, y는 멈춤값, z는 연속하는 두수의 차
>>> for i in range(0,5):
print(i)
0
1
2
3
4
>>> for i in range(5)
SyntaxError: invalid syntax
>>> for i in range(5):
print(i)
0
1
2
3
4
>>> for i in range(1,6):
for j in range(i):
print("*",end = "",)
***************
>>> for i in range(1,6):
for j in range(i):
print("*",end="",)
print()
*
**
***
****
*****
>>> dic = {"apple": "www.apple.com",
"python": "www.python.org",
"microsoft": "www.microsoft.com"}
>>> for k,v in dic.items():
print("{0} : {1}".format(k,v))
apple : www.apple.com
python : www.python.org
microsoft : www.microsoft.com
>>> for i in range(10):
if i%2 == 1:
continue
print(i)
0
2
4
6
8
>>>
================ RESTART: /Users/kimminsub/Documents/break.py ================
1
2
3
4
5
6
7
8
9
10
11
12
13
14
i is 15. the end.
>>>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment