Introduction to Programming with Python Displaying text Dileepa S. Rajapaksa| http://www.windowsgeek.lk @dsrajapaksa Microsoft Virtual Academy
Displaying text Print Microsoft Virtual Academy Last part Practice your language Microsoft Virtual Academy
මේ දේවල් වලට පරිගණකය භාවිතාකරලා තියෙනවාද? පොතක් කියවන්න. යම් නිෂ්පාදනයක් ගැන දැනගන්න. ප්රශ්ණයකට විසඳුමක් දැනගන්න පියවරයන් දැන ගැනීමට. Last part Practice your language Microsoft Virtual Academy
බොහෝ පරිගණක වැඩසටහන් තොරතුරු සපයනවා ඔබ දැනගතයුතු එක් සරල ඒ වගේම වැදගත් කරුණක්වන්නේ පරිගණක තිරය තුල Text එකක් Display කිරීම. No experience needed , if you have it is not a problem Microsoft Virtual Academy
Text එකක් Display කරන්න භාවිතාකරන්නේ Print statement එක print('Hickory Dickory Dock! The mouse ran up the clock') print("Hickory Dickory Dock! The mouse ran up the clock") ඔබට single quotes හෝ double quotes භාවිතා කලහැකියි No experience needed , if you have it is not a problem Microsoft Virtual Academy
Demo Printing text Microsoft Virtual Academy
Single quotes හෝ Double quotes භාවිතයේ ප්රශ්ණයක් ප්රශ්ණයක් තියෙනවාද? print("It's a beautiful day in the neighborhood") print('It's a beautiful day in the neighborhood') Display කරන්න යන text එකේ Double quotes හෝ Single quotes එකක් තිබෙනවානම් මේ ප්රශ්ණය මතුවෙනවා. Double quotes හා Single quotes වලින් එක් වර්ගයක් භාවිතා කිරීමට පුරුදු වෙන එක හොඳ පුරුද්දක්. Microsoft Virtual Academy
පේළි කිහිපයක් Print කිරීම Microsoft Virtual Academy
පේළි කිහිපයක Display කිරීමට මොකක්ද කරන්නේ? print statements කිහිපයක් භාවිතාකරන්න පුළුවන්. print('Hickory Dickory Dock!') print('The mouse ran up the clock') Microsoft Virtual Academy
අලුත් පේලි ආරම්භකිරීමට "\n" භාවිතාකරන්න පුළුවන්. print('Hickory Dickory Dock!\nThe mouse ran up the clock') Microsoft Virtual Academy
Python trick: triple quotes! print("""Hickory Dickory Dock! The mouse ran up the clock""") print('''Hickory Dickory Dock! The mouse ran up the clock''') String එකක් triple quotes අතර type කලොත් ඒ string එක ඒ type කරපු විදිහටම Print කරගන්න පුළුවන්. Microsoft Virtual Academy
Demo Printing text Microsoft Virtual Academy
එකම ගැටලුවක් | විසඳුම් කිහිපයක් Microsoft Virtual Academy
මෙයින් වඩා හොඳ මොකක්ද? print('Hickory Dickory Dock!') print('The mouse ran up the clock') print('Hickory Dickory Dock!\nThe mouse ran up the clock') print('''Hickory Dickory Dock! The mouse ran up the clock''')
Geek Tips එකම ප්රශ්ණයට විසඳුම් කිහිපයක් පවතින්න පුළුවන්. එකම ප්රශ්ණයට විසඳුම් කිහිපයක් පවතින්න පුළුවන්. සමහර අවස්ථා වලදී ක්රමය එතරම්ම වැදගත් නැහැ.
Demo විකල්ප කිහිපයක් | එකම ප්රතිඵලයක් Microsoft Virtual Academy
Code එකක් වැඩ නොකලොත් Microsoft Virtual Academy
Programming වලදී තවත් එක් වැදගත් දෙයක් වැරදි සිදුවීම සාමාන්ය දෙයක් . හැම Programmer කෙනෙක්ම Type කිරීමේ අත්වැරදි හා Code කිරීමේ අත්වැරදිසිදුකරනවා.
අපගේ අත්වැරදි හඳුනාගැනීම වැදගත්. print(Hickory Dickory Dock) print('It's a small world') print("Hi there') prnit("Hello World!") print('Hickory Dickory Dock') print("It's a small world") print("Hi there") print("Hello World!")
ඔබට අභියෝගයක්… There once was a movie star icon පහත දැක්වෙන Poem එක ඒ ආකාරයෙන්ම Display කිරීම සඳහා program එකක් ලියන්න. There once was a movie star icon who preferred to sleep with the light on. They learned how to code a device that sure glowed and lit up the night using Python!
Congratulations! දැන් ඔයාලට පුළුවන් තොරතුරු Display කරන්න පුළුවන් ආකාරයේ program එකක් හදන්න.