Python ကျူတိုရီရယ်

Python ပင်မစာမျက်နှာ Python နိဒါန်း Python ကို စတင်လိုက်ပါ။ Python Syntax Python မှတ်ချက်များ Python Variables များ Python Data အမျိုးအစားများ Python နံပါတ်များ Python Casting Python ကြိုးများ Python Booleans Python အော်ပရေတာများ Python စာရင်းများ Python Tuples Python အစုံများ Python အဘိဓာန်များ Python If... Else Python while Loops Python For Loops Python လုပ်ဆောင်ချက်များ Python Lambda Python Arrays Python အတန်းများ/အရာဝတ္ထုများ Python Inheritance Python Iterators Python နယ်ပယ် Python Modules Python နေ့စွဲများ Python သင်္ချာ Python JSON Python RegEx Python PIP Python ကိုစမ်းကြည့်ပါ... ကလွဲရင် Python အသုံးပြုသူ ထည့်သွင်းမှု Python String Formatting

ဖိုင်ကိုင်တွယ်ခြင်း။

Python ဖိုင်ကို ကိုင်တွယ်ခြင်း။ Python ဖိုင်များကိုဖတ်ပါ။ Python ဖိုင်များကို ရေးသားခြင်း/ဖန်တီးပါ။ Python ဖိုင်များကိုဖျက်ပါ။

Python Modules

NumPy ကျူတိုရီရယ် Panda ကျင့်စဉ် Scipy ကျူတိုရီရယ်

Python Matplotlib

Matplotlib နိဒါန်း Matplotlib ကို စတင်လိုက်ပါ။ Matplotlib Pyplot Matplotlib Plotting Matplotlib အမှတ်အသားများ Matplotlib လိုင်း Matplotlib အညွှန်းများ Matplotlib Grid Matplotlib အပိုင်းခွဲများ Matplotlib ဖြန့်ကြဲခြင်း။ Matplotlib ဘားများ Matplotlib Histograms Matplotlib Pie ဇယားများ

စက်သင်ယူခြင်း။

စတင်အသုံးပြုခြင်း Mean Median Mode စံလွဲခြင်း။ ရာခိုင်နှုန်း ဒေတာဖြန့်ဝေခြင်း။ ပုံမှန်ဒေတာဖြန့်ဝေ ကွက်ကျားကွက်၊ Linear Regression Polynomial Regression Multiple Regression အတိုင်းအတာ ရထား/စမ်းသပ်မှု ဆုံးဖြတ်ချက်သစ်ပင်

Python MySQL

MySQL စတင်လိုက်ပါ။ MySQL ဒေတာဘေ့စ်ဖန်တီးပါ။ MySQL ဇယားဖန်တီးပါ။ MySQL ထည့်သွင်းခြင်း။ MySQL ကို ရွေးပါ။ MySQL ဘယ်မှာလဲ။ MySQL Order By MySQL ကိုဖျက်ပါ။ MySQL Drop Table MySQL အပ်ဒိတ် MySQL ကန့်သတ်ချက် MySQL Join

Python MongoDB

MongoDB စတင်လိုက်ပါ။ MongoDB ဒေတာဘေ့စ်ဖန်တီးပါ။ MongoDB သည် Collection ကိုဖန်တီးပါ။ MongoDB ထည့်သွင်းပါ။ MongoDB ကိုရှာပါ။ MongoDB မေးခွန်း MongoDB အမျိုးအစား MongoDB ကိုဖျက်ပါ။ MongoDB Drop Collection MongoDB အပ်ဒိတ် MongoDB ကန့်သတ်ချက်

Python အကိုးအကား

Python ခြုံငုံသုံးသပ်ချက် Python Built-in လုပ်ဆောင်ချက်များ Python String နည်းလမ်းများ Python စာရင်းနည်းလမ်းများ Python Dictionary Methods Python Tuple နည်းလမ်းများ Python သတ်မှတ်နည်းလမ်းများ Python ဖိုင်နည်းလမ်းများ Python သော့ချက်စာလုံးများ Python ခြွင်းချက်များ Python ဝေါဟာရ

Module အကိုးအကား

ကျပန်း Module တောင်းဆိုမှုများ Module Statistics Module သင်္ချာ မော်ဂျူး cMath မော်ဂျူး

Python လုပ်နည်း

စာရင်းပွားများကို ဖယ်ရှားပါ။ ကြိုးတစ်ချောင်းကို ပြောင်းပြန် နံပါတ်နှစ်ခုထည့်ပါ။

Python ဥပမာများ

Python ဥပမာများ Python Compiler Python လေ့ကျင့်ခန်းများ Python Quiz Python လက်မှတ်

Python String ဖော် မတ်() နည်းလမ်း

❮ စာတန်းနည်းလမ်းများ


ဥပမာ

နေရာယူထားသည့်နေရာအတွင်းတွင် စျေးနှုန်းကို ထည့်သွင်းပါ၊ စျေးနှုန်းသည် ပုံသေအမှတ်၊ ဒဿမနှစ်ပုံဖော်မတ်ဖြင့် ဖြစ်သင့်သည်-

txt = "For only {price:.2f} dollars!"
print(txt.format(price = 49))

အဓိပ္ပါယ်နှင့် အသုံးပြုမှု

နည်းလမ်း သည် format()သတ်မှတ်ထားသော တန်ဖိုး(များ)ကို ဖော်မတ်ပေးပြီး string ၏ နေရာယူမှုအတွင်း ၎င်းတို့ကို ထည့်သွင်းပါ။

နေရာယူသူကို curly brackets များဖြင့် သတ်မှတ်သည်- {}။ အောက်ဖော်ပြပါ Placeholder ကဏ္ဍတွင် နေရာချထားသူများအကြောင်း ပိုမိုဖတ်ရှုပါ။

နည်းလမ်းသည် ဖော် မတ် format()လုပ်ထားသော စာကြောင်းကို ပြန်ပေးသည်။


အထားအသို

string.format(value1, value2...)

ကန့်သတ်တန်ဖိုးများ

Parameter Description
value1, value2... Required. One or more values that should be formatted and inserted in the string.

The values are either a list of values separated by commas, a key=value list, or a combination of both.

The values can be of any data type.

နေရာထိုင်ခင်း

{price}နေရာကိုင်ဆောင်သူများကို အမည်ပေးထားသော အညွှန်းများ ၊ နံပါတ်တပ်ထားသော အညွှန်းများ {0}သို့မဟုတ် နေရာလွတ်များပင် အသုံးပြု၍ ဖော်ထုတ် {}နိုင်ပါသည်။

ဥပမာ

မတူညီသော နေရာယူထားသည့် တန်ဖိုးများကို အသုံးပြုခြင်း-

txt1 = "My name is {fname}, I'm {age}".format(fname = "John", age = 36)
txt2 = "My name is {0}, I'm {1}".format("John",36)
txt3 = "My name is {}, I'm {}".format("John",36)

Formatting အမျိုးအစားများ

နေရာချထားသူများအတွင်းတွင် ရလဒ်ကိုဖော်မတ်လုပ်ရန် ဖော်မတ်အမျိုးအစားကို သင်ထည့်နိုင်သည်။

:< Left aligns the result (within the available space)
:> Right aligns the result (within the available space)
:^ Center aligns the result (within the available space)
:= Places the sign to the left most position
:+ Use a plus sign to indicate if the result is positive or negative
:- Use a minus sign for negative values only
Use a space to insert an extra space before positive numbers (and a minus sign before negative numbers)
:, Use a comma as a thousand separator
:_ Use a underscore as a thousand separator
:b Binary format
:c Converts the value into the corresponding unicode character
:d Decimal format
:e Scientific format, with a lower case e
:E Scientific format, with an upper case E
:f Fix point number format
:F Fix point number format, in uppercase format (show inf and nan as INF and NAN)
:g General format
:G General format (using a upper case E for scientific notations)
:o Octal format
:x Hex format, lower case
:X Hex format, upper case
:n Number format
:% Percentage format

❮ စာတန်းနည်းလမ်းများ