-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchapter05_02.py
More file actions
38 lines (29 loc) · 899 Bytes
/
chapter05_02.py
File metadata and controls
38 lines (29 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Chapter05-2
# 파이썬 사용자 입력
# Input 사용법
# 기본 타입(str)
# 예제1
name = input("Enter Your Name : ")
grade = input("Enter Your Grade : ")
company = input("Enter Your Company name : ")
print(name, grade, company)
print()
# 예제2
number = input("Enter number : ")
name = input("Enter name : ")
print("type of number", type(number), number * 3)
print("type of nanme", type(name))
print()
# 예제3(계산)
first_number = int(input("Enter number1 : "))
second_number = int(input("Enter number2 : "))
total = first_number + second_number
print("first_number + second_number : ", total)
print()
# 예제4
float_number = float(input("Enter a float number : "))
print("input float : ", float_number)
print("input type : ", type(float_number))
print()
# 예제5
print("FirstName - {0}, LastName - {1}".format(input("Enter first name : "), input("Enter second name : ")))