Sự khác biệt giữa Khóa học Python Crash 1 và 2 là gì?

Bài viết này dành cho những người đã có kinh nghiệm lập trình và muốn học nhanh Python

Tôi đã tạo tài nguyên này vì thất vọng khi không thể tìm thấy khóa học trực tuyến hoặc bất kỳ tài nguyên nào khác dạy Python cho các lập trình viên đã biết các ngôn ngữ lập trình khác

Trong khóa học này, tôi sẽ trình bày tất cả những kiến ​​thức cơ bản về Python [các bài học chuyên sâu sẽ được bổ sung sau] để bạn có thể bắt đầu làm quen với ngôn ngữ này một cách nhanh chóng

Mục lục

  • Thiết lập môi trường
  • Chào thế giới
  • Dây
  • Số
  • Trôi nổi
  • bool
  • Danh sách
  • Tuple
  • bộ
  • Từ điển
  • nếu. khác
  • vòng lặp
  • Chức năng
  • Các lớp học
  • mô-đun
  • Giá trị thật và giả
  • xử lý ngoại lệ

Thiết lập môi trường

Để bắt đầu, hãy cài đặt Python 3. Tôi khuyên bạn nên sử dụng VSCode làm trình chỉnh sửa của mình. Nó có rất nhiều tiện ích mở rộng để định cấu hình để bạn có thể thiết lập môi trường của mình chỉ trong vài phút

Chào thế giới

print["Hello world"]

Nếu bạn đã biết cơ bản về lập trình, có thể bạn sẽ biết cách chạy chương trình này. P. Lưu chương trình với phần mở rộng

# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.
8. Sau đó chạy
# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.
9 hoặc
2
2 * 3
2 ** 7
[2 + 3] * 4
0

Trong toàn bộ hướng dẫn này, chúng ta sẽ làm theo

2
2 * 3
2 ** 7
[2 + 3] * 4
1.
2
2 * 3
2 ** 7
[2 + 3] * 4
2 sẽ ngừng hoạt động vào năm 2020. Vì vậy, tôi nghĩ thật tốt khi sử dụng phiên bản mới nhất

Biến và kiểu dữ liệu

Các biến có thể chứa các chữ cái, số và dấu gạch dưới

Dây

# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.

Số

2
2 * 3
2 ** 7
[2 + 3] * 4

phao nổi

________số 8

Hãy cẩn thận trong nối

count = 5

print["I need" + count + "chocolates"] # This line will throw error. As count is a integer, you have to type cast it.

print["I need" + str[count] + "chocolates"] # This will work

bool

# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.
0

Danh sách

Danh sách về cơ bản giống như mảng. Trong thế giới Python, họ gọi chúng là

2
2 * 3
2 ** 7
[2 + 3] * 4
3. Và họ được lệnh

# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.
2

bộ dữ liệu

Bộ dữ liệu giống như danh sách nhưng chúng không thay đổi. Điều này có nghĩa là bạn không thể thêm hoặc cập nhật chúng. Bạn chỉ có thể đọc các yếu tố. Và hãy nhớ rằng, giống như danh sách, Tuples cũng tuần tự

# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.
3

bộ

Bộ là bộ sưu tập không có thứ tự không có phần tử trùng lặp

# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.
4

từ điển

Từ điển là bản đồ khóa-giá trị trong Python. Chúng không có thứ tự

# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.
5

nếu. khác

Bạn có thể đã biết cách hoạt động của câu lệnh

2
2 * 3
2 ** 7
[2 + 3] * 4
4. Nhưng hãy xem một ví dụ ở đây

# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.
0

vòng lặp

Python có hai loại vòng lặp

  1. Trong khi

vòng lặp while

# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.
1

Đối với vòng lặp

# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.
2

Chức năng

# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.
3

Các lớp học

# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.
4

mô-đun

# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.
5

Giá trị thật và giả

# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.
6

xử lý ngoại lệ

# This is comment in Python
msg_from_computer = "Hello" # String
another_msg ='Hello in single quote' # This is also a String.

print[msg_from_computer + " World..!"]

# Type will return the data type.
print[type[msg_from_computer]] # . We will see the explanation of this later.
7

Cảm ơn bạn đã đọc. ]

Được đăng ban đầu trong repo Github này. Khóa học Python

QUẢNG CÁO

QUẢNG CÁO

QUẢNG CÁO

QUẢNG CÁO

QUẢNG CÁO

QUẢNG CÁO

QUẢNG CÁO

QUẢNG CÁO

QUẢNG CÁO

QUẢNG CÁO

QUẢNG CÁO

QUẢNG CÁO

QUẢNG CÁO

QUẢNG CÁO

Srebalaji Thirumalai

Sản xuất tại Ấn Độ, Kỹ sư phần mềm, Trình tạo sê-ri, Rails ❤️ JavaScript

Nếu bạn đọc đến đây, hãy tweet cho tác giả để cho họ thấy bạn quan tâm. Tweet một lời cảm ơn

Học cách viết mã miễn phí. Chương trình giảng dạy mã nguồn mở của freeCodeCamp đã giúp hơn 40.000 người có được việc làm với tư cách là nhà phát triển. Bắt đầu

Khóa học về sự cố Python có đáng không?

Nhiều người đã hỏi liệu đọc một cuốn sách như Python Crash Course có đủ để kiếm việc làm lập trình viên không. Câu trả lời ngắn gọn là không; . the material in Python Crash Course is necessary for getting hired, but it's not sufficient.

Python Crash Course có tốt cho người mới bắt đầu không?

Khóa học này hoàn hảo cho người mới bắt đầu muốn học cách sử dụng ngôn ngữ lập trình Python . Bạn sẽ học mọi thứ từ thiết lập hệ thống đến cú pháp cơ bản để làm việc với API.

Khóa học Python Crash Phiên bản thứ 2 ra đời khi nào?

Tháng 5 năm 2019 , 544 trang.

Khóa học Python Crash dạy gì?

Khi hoàn thành Khóa học về sự cố Python, bạn sẽ học cách. Sử dụng các công cụ và thư viện Python mạnh mẽ, bao gồm matplotlib, NumPy và Pygal . Tạo các trò chơi 2D phản ứng với các lần nhấn phím và nhấp chuột và điều đó trở nên khó khăn hơn khi trò chơi tiến triển.

Chủ Đề