LogIn E-mail
설계이야기
print 줄바꿈
# 1 JMJS    19.11.11 09:52

>>> print(1, 2, 3, sep='\n')
1
2
3

>>> print('1\n2\n3')
1
2
3

print(1,end='')
print(2, end='')
print(3)
[실행결과]
123

print(1, end=' ')
print(2, end=' ')
print(3)
[실행결과]
1 2 3

print('name?', end="")
name = input();
print("name: {0}, type: {1}".format(name,type(name)))
name = input('name?');
print("name: {0}, type: {1}".format(name,type(name)))
name = input('type Ctrl+D or Ctrl+Z+Enter');

n=input("String?")
print(n,type(n))
n=eval(input("Number?"))
print(n,type(n))
n=int(input("Integer?"))
print(n,type(n))
n=int(input("Binary?"),2)
print(n,type(n))
n=int(input("Hexa?"),16)

n=float(input("Float?"))
print(n,type(n))

n=eval(input("type [1,2,3,4]:"))
print(n,type(n))

게시물: 30 건, 현재: 1 / 1 쪽
[1]
번호 제       목 작성자 등록일 방문
31  test1 jinsung 22.1.20 6
30  tuple 은 수정 못함 jinsung 21.11.6 29
29  ocr cv2 py jinsung 21.9.17 63
28  PIL to numpy jinsung 21.9.15 58
27  pygame.display.flip vs pygame.display.update jinsung 21.9.6 64
26  house.py jinsung 21.3.18 200
25  move_circle_j1.py jinsung 21.3.18 166
24  bounce_j1.py jinsung 21.3.18 153
23  모두의 파이썬 - 20일만에배우는 프로그래밍 기초 JMJS 20.1.8 327
22  python -m pip install -U pip JMJS 19.11.25 274
21  get =lambda i,m ... JMJS 19.11.13 287
20  2차원 리스트, 튜플 jinsung 21.11.6 304
19  [turtle]def polygon3(n,c,d) JMJS 19.11.11 275
18  [turtle]def polygon2(n,a) JMJS 19.11.11 282
17  def factorial(n) JMJS 19.11.11 258
16  def sum_func(n) JMJS 19.11.11 304
15  def hello() fun1(a) fun2(a,b) JMJS 19.11.11 286
14  while sum JMJS 19.11.11 250
13  random calculation JMJS 19.11.11 259
12  turtle random JMJS 19.11.11 264
11  import time time.time JMJS 19.11.11 273
10  turtle begin_fill end_fill JMJS 19.11.11 253
9  if else JMJS 19.11.11 255
8  input JMJS 19.11.11 265
7  list JMJS 19.11.11 279
6  turtle triangle JMJS 19.11.11 263
5  for range JMJS 19.11.11 255
4  모듈 사용하기 JMJS 19.11.11 264
3  import 파이썬 모듈 가져다 쓰기 JMJS 19.11.11 282
1  print 줄바꿈 JMJS 19.11.11 318
[1]