พอดีผมอ่านโค๊ด ที่เป็นฟังชั่นทำการคูณแต่อ่่นแล้สไม่เข้า พอดีผมมือใหม่มากๆนะครับ
อยากรบกวนหาคนอธิบายเพื่อให้หายปวดหัวหน่อยนะครับ code มีอยู่ว่า

def mult(a,b):
if b==0:
retrun 0
rest = mult(a,b-1)
value = a+rest
return value

รบกวนด้วยครับ

Hiring! บริษัทที่น่าสนใจ

Carmen Software company cover
Carmen Software
Hotel Financial Solutions
Next Innovation (Thailand) Co., Ltd. company cover
Next Innovation (Thailand) Co., Ltd.
We are web design with consulting & engineering services driven the future stronger and flexibility.
KKP Dime company cover
KKP Dime
KKP Dime บริษัทในเครือเกียรตินาคินภัทร
Kiatnakin Phatra Financial Group company cover
Kiatnakin Phatra Financial Group
Financial Service
Fastwork Technologies company cover
Fastwork Technologies
Fastwork.co เว็บไซต์ที่รวบรวม ฟรีแลนซ์ มืออาชีพจากหลากหลายสายงานไว้ในที่เดียวกัน
Thoughtworks Thailand company cover
Thoughtworks Thailand
Thoughtworks เป็นบริษัทที่ปรึกษาด้านเทคโนโยลีระดับโลกที่คว้า Great Place to Work 3 ปีซ้อน
Iron Software company cover
Iron Software
Iron Software is an American company providing a suite of .NET libraries by engineer for engineers.
CLEVERSE company cover
CLEVERSE
Cleverse is a Venture Builder. Our team builds several tech companies.
Nipa Cloud company cover
Nipa Cloud
#1 OpenStack cloud provider in Thailand with our own data center and software platform.
Bangmod Enterprise company cover
Bangmod Enterprise
The leader in Cloud Server and Hosting in Thailand.
CIMB THAI Bank company cover
CIMB THAI Bank
MOVING FORWARD WITH YOU - CIMB is the leading ASEAN Bank
Bangkok Bank company cover
Bangkok Bank
Bangkok Bank is one of Southeast Asia's largest regional banks, a market leader in business banking
MuvMi (Urban Mobility Tech Co.,Ltd.) company cover
MuvMi (Urban Mobility Tech Co.,Ltd.)
Shape the future of urban mobility towards affordable, clean, and safe solutions
T.N. Digital Solution Co., Ltd. company cover
T.N. Digital Solution Co., Ltd.
TNDS has been involving in every first move of banking’s major digital transformation.
KBTG - KASIKORN Business-Technology Group company cover
KBTG - KASIKORN Business-Technology Group
KBTG - "The Technology Company for Digital Business Innovation"
Siam Commercial Bank Public Company Limited company cover
Siam Commercial Bank Public Company Limited
"Let's start a brighter career future together"
Icon Framework co.,Ltd. company cover
Icon Framework co.,Ltd.
Global Standard Platform for Real Estate แพลตฟอร์มสำหรับธุรกิจอสังหาริมทรัพย์ครบวงจร มาตรฐานระดับโลก
REFINITIV company cover
REFINITIV
The Financial and Risk business of Thomson Reuters is now Refinitiv
H LAB company cover
H LAB
Re-engineering healthcare systems through intelligent platforms and system design.
The Gang Technology Co., Ltd. company cover
The Gang Technology Co., Ltd.
We're a Digital Agency that helps our customers transform their business into digital with ease.
LTMH company cover
LTMH
LTMH มุ่งเน้นการพัฒนาผลิตภัณฑ์ที่สามารถช่วยพันธมิตรของเราให้บรรลุเป้าหมาย
Seven Peaks company cover
Seven Peaks
We Drive Digital Transformation
Wisesight (Thailand) Co., Ltd. company cover
Wisesight (Thailand) Co., Ltd.
The Best Choice For Handling Social Media · High Expertise in Social Data · Most Advanced and Secure
MOLOG Tech company cover
MOLOG Tech
We are Modern Logistic Platform, Specialize in WMS, OMS and TMS.
Data Wow Co.,Ltd company cover
Data Wow Co.,Ltd
We enable our clients to realize increased productivity by solving their most complex issues by Data
LINE Company Thailand company cover
LINE Company Thailand
LINE, the world's hottest mobile messaging platform, offers free text and voice messaging + Call
LINE MAN Wongnai company cover
LINE MAN Wongnai
Join our journey to becoming No.1 food platform in Thailand

g1a5o2 Sun, 18/07/2010 - 23:17

def mult(a,b): ชื่อฟังค์ชันกับพารามิเตอรื
if b==0: ตรวจสอบว่า b มีค่าเป็น 0 ก็ให้คืนค๋า 0
retrun 0
rest = mult(a,b-1) ตรงนี้เป็น recursive โดยจะทำการเรียนตัวเองด้วยการลบค่าของ b ไปเรือย ๆ
value = a+rest
return value

Ex a = 3, b = 3
รอบที 1
value = 3 + 2
รอบที่ 2
value = 3 + 1
รอบสุดทั้
value = 0

ผลลัพท์ที่ได้ทั้ง 3 รอบคือ ( 3 + 2 ) + ( 3 + 1 ) + 0

ประมาณนี้ผมอธิบายแล้วเข้าใจหรือเปล่าก็ไม่แน่ใจ

  1. การบ้านรึเปล่าครับ ถ้าใช่ช่วยลงโจทย์เต็มๆ ด้วยครับ (ถามการบ้านไม่ผิดครับ)
  2. ไม่เข้าใจตรงไหน และเข้าใจตรงไหนครับ พยายามอธิบายสิ่งที่คุณเข้าใจออกมา

ครับผม ขอบคุณครับ คือ มันจะทำการวนรอบไปเรื่อยๆ จนได้ 0 ช่ายไหมครับ

พอดีผมนั่งอ่านหนังสือ นะครับ แล้ว งงๆ นิดหน่อยกับโจทย์และคำอธิบายนะครับ เพราะมันเป็น text book เลยมาขอรบกวนนิดหน่อยนะครับ

อีกนิดครับ
ทั้งๆที่ไม่มีการ วน รอบแล้วฟังชั่นนี้มันวนตัวเองด้วยทำสั่งไหนหรอครับ เพราะ return ก็ชี้ไปที่ value หรอว่า rest จะวันตัวเองไปเรื่อยๆ หรอครับ

พอดีผมหัดเองนะครับ เลยอาจจะสอบถามเยอะหน่อยนะครับ
หาคนคุยด้วยยากมากเลย อยากได้คนชี้แนะ นะครับเพราะอยากเป็นเร็วๆมาก

มันวนจากการที่มีการเรียกฟังก์ชั่น mult ภายใน mult น่ะครับ จะเรียกว่าวนก็ไม่ถูกเท่าไหร่ ... เทคนิคนี้เรียกว่า recursion ครับ เป็นการเรียกฟังก์ชั่นแบบ recursive

การที่จะเขียน python ควบ กับ sql ต้องศึกษา ทั้งคู่พร้อมๆ กันหรอว่า ศึกษา อย่างไดอย่างถึงให้คล่องไปก่อนดีครับ

ส่วนตัวผมกำลังเต็มที่กับ python นะครับ แต่ project ที่ผมคิดไว้ ต้องการทำระบบ pos นะครับ
ที่จะต้องมีการเชื่อมต่อ sql คิดไว้เป็น mysql หรือ ตัวไหนดีครับ รบกวนขอคำชี้แนะ ด้วยครับ

มันมีโมดูล mysql อยู่นะครับ

แต่กับการออกแบบแอพลิเคชั่นยุคใหม่ ควรใช้โมดูลตระกูล ORM จะดีกว่าครับ แอพเราจะดูแลง่ายขึ้น ตัวที่แนะนำก็เช่น SQLAlchemy

ขอบคุณมากนะครับ ที่แนะแนวทาง มีข้อมูลส่วนไหนในการศึกษาได้อีกรบกวน ชี้แนะด้วยนะครับ
เท่าที่ผมอ่านอยู่ก็มี หนังสืออยู่ 8-9 เล่ม text-book ประมาณ 8 เล่ม

Addison.Wesley.Programming.in.Python
Apress_Beginning_Python_From_Novice_to_Professional
Expert.Python.Programming-SL
Python programming - ของไทยนะครับ
Python_Tutorial ของไทยเช่นกัน
Non-Programmer's_Tutorial_for_Python
Wrox.Professional.IronPython.Mar.2010
แล้วก็หนังสือ การเขียนโปรแกรมภาษาไพธอนด้วยตนเอง

มีอันไหนที่น่าสนใจอีกหรอไม่ครับรบกวนด้วยนะครับ