Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
ඔයාගෙ Assignment හෝ Thesis එක හරියට හදාගමු
ErMurazor
Updated:
Saturday at 10:52 PM
Ad icon
BlackWall V2ray servers
hu KANNA
Updated:
Wednesday at 4:58 AM
Peppa Pig Family Plush Toy Set – 5 Characters
anil1961
Updated:
Sep 19, 2026
Ad icon
Express VPN PC - 1 Year Rs. 600.00
Sanathbh
Updated:
Sep 19, 2026
Ad icon
Capcut Pro 7 Days Team Plan - Rs. 3️⃣0️⃣0️⃣
Sanathbh
Updated:
Sep 19, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
Python වැඩ්ඩෝ එන්න
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="ArnoDorian" data-source="post: 23791853" data-attributes="member: 563715"><p><strong>for loop</strong></p><p></p><p>[CODE]def length(str1):</p><p></p><p> count = 0</p><p></p><p> for char in str1:</p><p> count += 1</p><p> return count</p><p>[/CODE]</p><p></p><p></p><p>for loop eka athule 'return' eke indentation eka adu karanna.</p><p></p><p></p><p>[CODE]print=(string_length('abc')[/CODE] </p><p></p><p>me code eka waradi. ')' adui!.</p><p></p><p></p><p>Anika 'print()' kiyane fn ekak, oya uda tiyena line eken print fn eka replace wenava.</p><p></p><p></p><p></p><p></p><p>Thani function ekak one nm</p><p>[CODE]def string_length(str1):</p><p> """Prints the length of the string"""</p><p></p><p> count=0</p><p> for char in str1:</p><p> count += 1</p><p> print(count)</p><p>[/CODE]</p><p></p><p>OR</p><p></p><p></p><p>[CODE]def string_length(str1):</p><p> """Returns the length of the string"""</p><p></p><p> count=0</p><p> for char in str1:</p><p> count += 1</p><p> return count[/CODE]</p><p></p><p></p><p></p><p></p><p>then use: [CODE]print(string_length("abc"))[/CODE]</p></blockquote><p></p>
[QUOTE="ArnoDorian, post: 23791853, member: 563715"] [b]for loop[/b] [CODE]def length(str1): count = 0 for char in str1: count += 1 return count [/CODE] for loop eka athule 'return' eke indentation eka adu karanna. [CODE]print=(string_length('abc')[/CODE] me code eka waradi. ')' adui!. Anika 'print()' kiyane fn ekak, oya uda tiyena line eken print fn eka replace wenava. Thani function ekak one nm [CODE]def string_length(str1): """Prints the length of the string""" count=0 for char in str1: count += 1 print(count) [/CODE] OR [CODE]def string_length(str1): """Returns the length of the string""" count=0 for char in str1: count += 1 return count[/CODE] then use: [CODE]print(string_length("abc"))[/CODE] [/QUOTE]
Insert quotes…
Verification
Dahaya deken beduwama keeyada?
Post reply
Top
Bottom