Welcome to ZyberPH. Be one of us! Read first our VIP RULES. For more info and guide you. Read our FAQ

Python Programming SERIES: #3

Discussions related to C++, HTML, PHP, ASP, ColdFusion, JavaScript, Perl, Python, Ruby, WML, SQL, XML, and other programming languages.
Post Reply
User avatar
cavin12400
Developer
Developer
Posts: 25
Joined: Wed Apr 06, 2016 12:10 pm
Location: Y̢ǫu͟ ͞c̶a̴n'҉t trac̨k ̡m̡e
Contact:

Python Programming SERIES: #3

Post by cavin12400 »

Hello mga ka Zyber! Welcome to #3 of Python Programming Series.

START: Manipulating Variables

How's your day? So last time nag run through tayo kung ano ang variable.
and ngayon naman is about sa iba't-ibang paggamit ng variable or uses neto.
You might as well notice na hindi po ako sumusunod sa mga tutorials sa youtube at sa iba pa. gusto ko po kasing mas makatuto yung ZERO experience talaga sa Programming. Kaya if you're an advance or meron experience. there is no need for you to have this tutorial. Just go to youtube. You'll have it there. PARA PO ITO SA ZERO EXPERIENCE na tao. Kaya po merong pictures. so just bear with it. So much for that! Let's start!

Variable as an INTEGER

~> So what is an INTEGER? Integer po! t*ng*n* di niyo alam? Joke. Kagaya sa math. INTEGER IS A WHOLE NUMBER THAT CAN BE POSITIVE OR NEGATIVE INCLUDING ZERO. so example of intergers are: -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5.
~> So, pano gamitin ang variable para maging integer? edi gagamit nanaman po tayo ng ASSIGNMENT OPERATOR "=".
~> So just follow me para sa examples.
>>myInteger1 = -5
>>myInteger2 = 3
>>myInteger3 = 143
Image

~> So there you go! So e try nating gamitin!
~> Sa math ano ang ginagawa sa mga numbers? edi ginagamit para e add,subtract,multiply, at divide.
~> Pano yan gawin? Simple lang. gagawa tayo ng isang variable na mag a-act as container ng answer ng dalawang number.
for Example: myAnswer = myInteger1 + myInteger2
~> at e print natin ang answer para makita: print(myAnswer)
Image

~> Let's run it!
Image
~> Sa ang answer ay: 138 because -5 + 143 = 138.
~> So pwedeng pwede niyo iba ibahin ang mga operation niyan.

Variable as a STRING

~> So what is a STRING? Hindi po yan tali. STRING po is a sequence and combination of CHARACTER(Char), so ano ang CHARACTER? ang char po ay isang simpleng letter lamang. for example: A,a,B,b,C,c.
~> So sequence and combination, so ano na ang string ngayon? So ang string ay isang SENTENCE or group of CHARACTER.
~> NOTE: Ang space po ay considered na pwedeng ma count as a string or character.
Example:
>>myString1 = "cavin12400"
>>myString2 = "androidcribs"
>>myString3 = "Pewdiepie"
Image

~> So ayan meron kanang variable na value a string!
~> So e print natin!
>>print(myString1)
>>print(myString2)
>>print(myString3)
Image

~>Run natin!
Image

Variable as FLOAT

~> Hindi po mango float. haha. FLOAT is simply a decimal number. for example, kapag meron kang zero(0) if converted yan sa float ay magiging 0.0.
ang 1 naman ay magiging 1.0. So ano uses neto? Of course malaki tulong nyan kagaya ng pagdisplay ng fractional or decimal answers.
example: 3/2 = 1.5
so kapag integer kasi ginamit mo diyan hindi yan mag didisplay. ang didisplay niya is 1 instead of 1.5. Kasi nga INTEGER!
~> So pano e convert?
~> here! ipasok mo ang number sa isang float. exactly float na word.
example:
>>myInteger1 = float(-5)
>>myInteger2 = float(3)
>>myInteger3 = float(2)
>>myAnswer = myInteger2 / myInteger 3
~> at saka e print: print(myAnswer)
Image
~> SIMPLE AS THAT!
~> TAPOS NA PO! Advance kasi yung ibang data type like tuple,list,set,dict.

Leave a positive review and follow my next tutorial! Next>> Python Programming SERIES: #4 (INPUT/OUTPUT)
f**k!
User avatar
Mzteriozo
Moderator
Moderator
Posts: 204
Joined: Thu Sep 08, 2016 3:13 am
Location: Lupang Sinilangan
Contact:

Re: Python Programming SERIES: #3

Post by Mzteriozo »

parang same lang ng =vlookup sa excel ^_^ basic pero okay na din thanks for sharing ~
i'm not going to censor myself to comfort your ignorance
Image
User avatar
Androidcribs
Admin
Admin
Posts: 463
Joined: Sat Feb 27, 2016 8:54 am
Location: Android world
Contact:

Re: Python Programming SERIES: #3

Post by Androidcribs »

Thanks for sharing bro. More tutorials from you. -thumbsup-
Compilation of Android Roms, Recoverys, Apps, Games and Tricks
Visit us my blog http://androidcibs.com
Androidcribs.com
Androidcribs
Image
User avatar
cavin12400
Developer
Developer
Posts: 25
Joined: Wed Apr 06, 2016 12:10 pm
Location: Y̢ǫu͟ ͞c̶a̴n'҉t trac̨k ̡m̡e
Contact:

Re: Python Programming SERIES: #3

Post by cavin12400 »

Mzteriozo wrote:parang same lang ng =vlookup sa excel ^_^ basic pero okay na din thanks for sharing ~
Yes ganyan lang po ka simple sa python. Simple lang. Pero mas magiging tricky yan kapag nagproprogress kana. Kaya naman pro. follow mo series ko. HAHAHA thanks din po sa panahon at pagbasa. :TY2:
f**k!
Post Reply

Return to “Programming & Web Design”