[{"content":"What did I learn in this practice session? A chromatic scale Current piece(s) for this week Gavotte by Amy Mary Beach La Poupee by Alexandre Tansman Study by Concone Tarantella Feedback on previous pieces Gavotte: Roll right hand on bar 30 \u0026amp; 38, work on bar 7-8 with left hand Tarantella: roll left hand on bar 58 Study: higher tempo, roll right hand on bar 16 La Poupee: keep the volume lower, hold notes on left hand longer on bar 12 avoid making random mistakes!! Improvements force is played enough La Poupee bar 16 is played clearly Study bar 8 is played smoothly Bar 11 from Gavotte is played good ","permalink":"https://sourfox.khmersite.net/p/2026/07/piano-notes-10/","summary":"\u003ch2 id=\"what-did-i-learn-in-this-practice-session\"\u003eWhat did I learn in this practice session?\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eA chromatic scale\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"current-pieces-for-this-week\"\u003eCurrent piece(s) for this week\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eGavotte by Amy Mary Beach\u003c/li\u003e\n\u003cli\u003eLa Poupee by Alexandre Tansman\u003c/li\u003e\n\u003cli\u003eStudy by Concone\u003c/li\u003e\n\u003cli\u003eTarantella\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"feedback-on-previous-pieces\"\u003eFeedback on previous pieces\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eGavotte: Roll right hand on bar 30 \u0026amp; 38, work on bar 7-8 with left hand\u003c/li\u003e\n\u003cli\u003eTarantella: roll left hand on bar 58\u003c/li\u003e\n\u003cli\u003eStudy: higher tempo, roll right hand on bar 16\u003c/li\u003e\n\u003cli\u003eLa Poupee: keep the volume lower, hold notes on left hand longer on bar 12\u003c/li\u003e\n\u003cli\u003eavoid making random mistakes!!\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"improvements\"\u003eImprovements\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eforce is played enough\u003c/li\u003e\n\u003cli\u003eLa Poupee bar 16 is played clearly\u003c/li\u003e\n\u003cli\u003eStudy bar 8 is played smoothly\u003c/li\u003e\n\u003cli\u003eBar 11 from Gavotte is played good\u003c/li\u003e\n\u003c/ul\u003e","title":"Piano Notes 10"},{"content":"What did I learn in this practice session? C minor (E♭, A♭) Current piece(s) for this week Gavotte by Amy Mary Beach La Poupee by Alexandre Tansman Study by Concone Tarantella Feedback on previous pieces Gavotte: Focus on bar 7 and 11-12 Tarantella: roll left hand on bar 58, play more staccato on pg 48 Study: Focus on bar 8 and 24 La Poupee: bar 12 and 16 must be played clearly play harder on piano. More force. Improvements Pinky on left hand is heard clearly on pg 48 ","permalink":"https://sourfox.khmersite.net/p/2026/06/piano-notes-9/","summary":"\u003ch2 id=\"what-did-i-learn-in-this-practice-session\"\u003eWhat did I learn in this practice session?\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eC minor (E♭, A♭)\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"current-pieces-for-this-week\"\u003eCurrent piece(s) for this week\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eGavotte by Amy Mary Beach\u003c/li\u003e\n\u003cli\u003eLa Poupee by Alexandre Tansman\u003c/li\u003e\n\u003cli\u003eStudy by Concone\u003c/li\u003e\n\u003cli\u003eTarantella\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"feedback-on-previous-pieces\"\u003eFeedback on previous pieces\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eGavotte: Focus on bar 7 and 11-12\u003c/li\u003e\n\u003cli\u003eTarantella: roll left hand on bar 58, play more staccato on pg 48\u003c/li\u003e\n\u003cli\u003eStudy: Focus on bar 8 and 24\u003c/li\u003e\n\u003cli\u003eLa Poupee: bar 12 and 16 must be played clearly\u003c/li\u003e\n\u003cli\u003eplay harder on piano. More force.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"improvements\"\u003eImprovements\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003ePinky on left hand is heard clearly on pg 48\u003c/li\u003e\n\u003c/ul\u003e","title":"Piano Notes 9"},{"content":"What did I learn in this practice session? E♭ major (A♭, B♭, E♭) Current piece(s) for this week Gavotte by Amy Mary Beach La Poupee by Alexandre Tansman Study by Concone Tarantella Feedback on previous pieces Gavotte: Focus bar 11 - 12, dynamics from bars 9 - 16 Tarantella: Practice bars 54 - 58, roll left hand on bar 58, more forte, make sure pinky is played for left hand throughout pg 48 Study: Practice by 2 bars by 2 bars, focus on bars 23 - 24 mp can be played normal (more pressure) on piano Improvements La Poupee tempo is good but almost there Tarantella has consistent tempo ","permalink":"https://sourfox.khmersite.net/p/2026/06/piano-notes-8/","summary":"\u003ch2 id=\"what-did-i-learn-in-this-practice-session\"\u003eWhat did I learn in this practice session?\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eE♭ major (A♭, B♭, E♭)\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"current-pieces-for-this-week\"\u003eCurrent piece(s) for this week\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eGavotte by Amy Mary Beach\u003c/li\u003e\n\u003cli\u003eLa Poupee by Alexandre Tansman\u003c/li\u003e\n\u003cli\u003eStudy by Concone\u003c/li\u003e\n\u003cli\u003eTarantella\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"feedback-on-previous-pieces\"\u003eFeedback on previous pieces\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eGavotte: Focus bar 11 - 12, dynamics from bars 9 - 16\u003c/li\u003e\n\u003cli\u003eTarantella: Practice bars 54 - 58, roll left hand on bar 58, more forte, make sure pinky is played for left hand throughout pg 48\u003c/li\u003e\n\u003cli\u003eStudy: Practice by 2 bars by 2 bars, focus on bars 23 - 24\u003c/li\u003e\n\u003cli\u003emp can be played normal (more pressure) on piano\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"improvements\"\u003eImprovements\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eLa Poupee tempo is good but almost there\u003c/li\u003e\n\u003cli\u003eTarantella has consistent tempo\u003c/li\u003e\n\u003c/ul\u003e","title":"Piano Notes 8"},{"content":"Current piece(s) for this week Gavotte by Amy Mary Beach La Poupee by Alexandre Tansman Study by Concone Tarantella Feedback on previous pieces Gavotte: increasing tempo even more La Poupee: increasing tempo Tarantelle: keep consistent tempo Study: increasing tempo, dynamics Improvements Left hand is good for La Poupee Tarantella tempo good Able to play all notes without stopping in Study ","permalink":"https://sourfox.khmersite.net/0/2026/06/piano-notes-7/","summary":"\u003ch2 id=\"current-pieces-for-this-week\"\u003eCurrent piece(s) for this week\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eGavotte by Amy Mary Beach\u003c/li\u003e\n\u003cli\u003eLa Poupee by Alexandre Tansman\u003c/li\u003e\n\u003cli\u003eStudy by Concone\u003c/li\u003e\n\u003cli\u003eTarantella\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"feedback-on-previous-pieces\"\u003eFeedback on previous pieces\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eGavotte: increasing tempo even more\u003c/li\u003e\n\u003cli\u003eLa Poupee: increasing tempo\u003c/li\u003e\n\u003cli\u003eTarantelle: keep consistent tempo\u003c/li\u003e\n\u003cli\u003eStudy: increasing tempo, dynamics\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"improvements\"\u003eImprovements\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eLeft hand is good for La Poupee\u003c/li\u003e\n\u003cli\u003eTarantella tempo good\u003c/li\u003e\n\u003cli\u003eAble to play all notes without stopping in Study\u003c/li\u003e\n\u003c/ul\u003e","title":"Piano Notes 7"},{"content":"Current piece(s) for this week Gavotte by Amy Mary Beach La Poupee by Alexandre Tansman Study by Concone Tarantella Feedback on previous pieces Gavotte: increasing tempo even more La Poupee: increasing tempo Tarantella: keep consistent tempo Study: increasing tempo, dynamics Improvements Left hand is good for La Poupee Tarantella tempo good Able to play all notes without stopping in Study Others Based on current progess, piano exam could be taken in end of August ","permalink":"https://sourfox.khmersite.net/p/2026/06/piano-notes-7/","summary":"\u003ch2 id=\"current-pieces-for-this-week\"\u003eCurrent piece(s) for this week\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eGavotte by Amy Mary Beach\u003c/li\u003e\n\u003cli\u003eLa Poupee by Alexandre Tansman\u003c/li\u003e\n\u003cli\u003eStudy by Concone\u003c/li\u003e\n\u003cli\u003eTarantella\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"feedback-on-previous-pieces\"\u003eFeedback on previous pieces\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eGavotte: increasing tempo even more\u003c/li\u003e\n\u003cli\u003eLa Poupee: increasing tempo\u003c/li\u003e\n\u003cli\u003eTarantella: keep consistent tempo\u003c/li\u003e\n\u003cli\u003eStudy: increasing tempo, dynamics\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"improvements\"\u003eImprovements\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eLeft hand is good for La Poupee\u003c/li\u003e\n\u003cli\u003eTarantella tempo good\u003c/li\u003e\n\u003cli\u003eAble to play all notes without stopping in Study\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"others\"\u003eOthers\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eBased on current progess, piano exam could be taken in end of August\u003c/li\u003e\n\u003c/ul\u003e","title":"Piano Notes 7"},{"content":"What did I learn in this practice session? B♭ major (B♭ \u0026amp; E♭) Current piece(s) for this week Gavotte by Amy Mary Beach La Poupee by Alexandre Tansman Study by Concone Tarantella Feedback on previous pieces Gavotte: increasing tempo La Poupee: increasing tempo, hold left hand longer Tarantella: dynamics Study: no stopping, articulation, increasing tempo, phrasing, dynamics Improvements Dynamics is good for La Poupee Tarantella notes are each played clearly Press the keys all the way down (acoustic piano thing) ","permalink":"https://sourfox.khmersite.net/p/2026/06/piano-notes-6/","summary":"\u003ch2 id=\"what-did-i-learn-in-this-practice-session\"\u003eWhat did I learn in this practice session?\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eB♭ major (B♭ \u0026amp; E♭)\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"current-pieces-for-this-week\"\u003eCurrent piece(s) for this week\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eGavotte by Amy Mary Beach\u003c/li\u003e\n\u003cli\u003eLa Poupee by Alexandre Tansman\u003c/li\u003e\n\u003cli\u003eStudy by Concone\u003c/li\u003e\n\u003cli\u003eTarantella\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"feedback-on-previous-pieces\"\u003eFeedback on previous pieces\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eGavotte: increasing tempo\u003c/li\u003e\n\u003cli\u003eLa Poupee: increasing tempo, hold left hand longer\u003c/li\u003e\n\u003cli\u003eTarantella: dynamics\u003c/li\u003e\n\u003cli\u003eStudy: no stopping, articulation, increasing tempo, phrasing, dynamics\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"improvements\"\u003eImprovements\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eDynamics is good for La Poupee\u003c/li\u003e\n\u003cli\u003eTarantella notes are each played clearly\u003c/li\u003e\n\u003cli\u003ePress the keys all the way down (acoustic piano thing)\u003c/li\u003e\n\u003c/ul\u003e","title":"Piano Notes 6"},{"content":"Current piece(s) for this week Gavotte by Amy Mary Beach La Poupee by Alexandre Tansman Study by Concone Tarantella Feedback on previous pieces I need to improve on dynamics for every piece I need to improve on increasing the tempo for La Poupee, Gavotte, and Study I need to work on the 2 last bars of La Poupee Practice 2 certain bars on Gavotte. (10 times each) Remember to roll hand when playing Study ","permalink":"https://sourfox.khmersite.net/p/2026/05/piano-notes-5/","summary":"\u003ch2 id=\"current-pieces-for-this-week\"\u003eCurrent piece(s) for this week\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eGavotte by Amy Mary Beach\u003c/li\u003e\n\u003cli\u003eLa Poupee by Alexandre Tansman\u003c/li\u003e\n\u003cli\u003eStudy by Concone\u003c/li\u003e\n\u003cli\u003eTarantella\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"feedback-on-previous-pieces\"\u003eFeedback on previous pieces\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eI need to improve on dynamics for every piece\u003c/li\u003e\n\u003cli\u003eI need to improve on increasing the tempo for La Poupee, Gavotte, and Study\u003c/li\u003e\n\u003cli\u003eI need to work on the 2 last bars of La Poupee\u003c/li\u003e\n\u003cli\u003ePractice 2 certain bars on Gavotte. (10 times each)\u003c/li\u003e\n\u003cli\u003eRemember to roll hand when playing Study\u003c/li\u003e\n\u003c/ul\u003e","title":"Piano Notes 5"},{"content":"What did I learn in this practice session? F chromatic scale \u0026ldquo;Sopra\u0026rdquo; (means above or over) Current piece(s) for this week Gavotte by Amy Mary Beach La Poupee by Alexandre Tansman Study by Concone Tarantelle Feedback on previous pieces I need to improve on dynamics for La Poupee. Tarantelle tempo is good. I need to improve on making the tempo for Study a bit faster ","permalink":"https://sourfox.khmersite.net/p/2026/05/piano-notes-4/","summary":"\u003ch2 id=\"what-did-i-learn-in-this-practice-session\"\u003eWhat did I learn in this practice session?\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eF chromatic scale\u003c/li\u003e\n\u003cli\u003e\u0026ldquo;Sopra\u0026rdquo; (means above or over)\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"current-pieces-for-this-week\"\u003eCurrent piece(s) for this week\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eGavotte by Amy Mary Beach\u003c/li\u003e\n\u003cli\u003eLa Poupee by Alexandre Tansman\u003c/li\u003e\n\u003cli\u003eStudy by Concone\u003c/li\u003e\n\u003cli\u003eTarantelle\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"feedback-on-previous-pieces\"\u003eFeedback on previous pieces\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eI need to improve on dynamics for La Poupee.\u003c/li\u003e\n\u003cli\u003eTarantelle tempo is good.\u003c/li\u003e\n\u003cli\u003eI need to improve on making the tempo for Study a bit faster\u003c/li\u003e\n\u003c/ul\u003e","title":"Piano Notes 4"},{"content":"Feedback on previous pieces Focus mainly on two lines of Study Work on the last 3 bars of La Poupee Practice playing staccato softer ","permalink":"https://sourfox.khmersite.net/p/2026/05/piano-notes-3/","summary":"\u003ch2 id=\"feedback-on-previous-pieces\"\u003eFeedback on previous pieces\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eFocus mainly on two lines of Study\u003c/li\u003e\n\u003cli\u003eWork on the last 3 bars of La Poupee\u003c/li\u003e\n\u003cli\u003ePractice playing staccato softer\u003c/li\u003e\n\u003c/ul\u003e","title":"Piano Notes 3"},{"content":"What did I learn in this practice session? D harmonic minor (b flat, c#) Feedback on previous pieces I need to improve on slur. I need to improve on fixing the fingering for La Poupee I need to improve on f major Play the specified bar the teacher outlined to me 3 times in a row ","permalink":"https://sourfox.khmersite.net/p/2026/05/piano-notes-2/","summary":"\u003ch2 id=\"what-did-i-learn-in-this-practice-session\"\u003eWhat did I learn in this practice session?\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eD harmonic minor (b flat, c#)\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"feedback-on-previous-pieces\"\u003eFeedback on previous pieces\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eI need to improve on slur.\u003c/li\u003e\n\u003cli\u003eI need to improve on fixing the fingering for La Poupee\u003c/li\u003e\n\u003cli\u003eI need to improve on f major\u003c/li\u003e\n\u003cli\u003ePlay the specified bar the teacher outlined to me 3 times in a row\u003c/li\u003e\n\u003c/ul\u003e","title":"Piano Notes 2"},{"content":"What did I learn in this practice session? E minor (F#, D#) New piece(s) for this week Gavotte by Amy Mary Beach La Poupee by Alexandre Tansman Study by Concone Feedback on previous pieces I need to improve on slur. I need to improve on pressing the keys all the way down. Make Tarentella more clearer. Make the Harmonica more fluent. Others Ask teacher about how to use the metronome during piano. PAY DA FEE ","permalink":"https://sourfox.khmersite.net/p/2026/05/piano_notes/","summary":"\u003ch2 id=\"what-did-i-learn-in-this-practice-session\"\u003eWhat did I learn in this practice session?\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eE minor (F#, D#)\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"new-pieces-for-this-week\"\u003eNew piece(s) for this week\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eGavotte by Amy Mary Beach\u003c/li\u003e\n\u003cli\u003eLa Poupee by Alexandre Tansman\u003c/li\u003e\n\u003cli\u003eStudy by Concone\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"feedback-on-previous-pieces\"\u003eFeedback on previous pieces\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eI need to improve on slur.\u003c/li\u003e\n\u003cli\u003eI need to improve on pressing the keys all the way down.\u003c/li\u003e\n\u003cli\u003eMake Tarentella more clearer.\u003c/li\u003e\n\u003cli\u003eMake the Harmonica more fluent.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"others\"\u003eOthers\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eAsk teacher about how to use the metronome during piano.\u003c/li\u003e\n\u003cli\u003ePAY DA FEE\u003c/li\u003e\n\u003c/ul\u003e","title":"Piano notes"},{"content":"Intro Ever needed to quickly convert Celsius to Fahrenheit right from your terminal? Look no further! I\u0026rsquo;ve put together a neat little command-line tool in Rust that does just that. It\u0026rsquo;s a great example of Rust\u0026rsquo;s simplicity and power for building practical utilities.\nWhat It Does This project is a straightforward temperature converter. You run it, input a temperature in Celsius, and it instantly spits out the equivalent in Fahrenheit. No fuss, no complex GUIs – just pure, efficient command-line goodness.\nHow It Works (A Peek Under the Hood) The core logic is quite simple, leveraging Rust\u0026rsquo;s robust standard library for input/output and basic arithmetic. The conversion itself uses the classic formula:\nfn celsius_to_fahrenheit(celsius: f64) -\u0026gt; f64 { celsius * 9.0 / 5.0 + 32.0 } The program also includes a loop to ensure valid numeric input, prompting the user again if they enter something that isn\u0026rsquo;t a number. This makes the tool user-friendly and resilient.\nGive It a Spin! If you have Rust and Cargo installed, you can easily try it out:\nClone the repository (or create the files if you\u0026rsquo;re following along). Navigate to the project directory in your terminal. Run the program: cargo run Follow the prompts to enter your Celsius temperature. ","permalink":"https://sourfox.khmersite.net/p/2025/06/converting-temperature/","summary":"\u003ch2 id=\"intro\"\u003eIntro\u003c/h2\u003e\n\u003cp\u003eEver needed to quickly convert Celsius to Fahrenheit right from your terminal? Look no further! I\u0026rsquo;ve put together a neat little command-line tool in Rust that does just that. It\u0026rsquo;s a great example of Rust\u0026rsquo;s simplicity and power for building practical utilities.\u003c/p\u003e\n\u003ch3 id=\"what-it-does\"\u003eWhat It Does\u003c/h3\u003e\n\u003cp\u003eThis project is a straightforward temperature converter. You run it, input a temperature in Celsius, and it instantly spits out the equivalent in Fahrenheit. No fuss, no complex GUIs – just pure, efficient command-line goodness.\u003c/p\u003e","title":"Converting Temperature from Celsius to Fahrenheit"},{"content":"Hi there! Today, instead of writing another python program, I had wrote a rust program. In this code, the goal was to ask for user\u0026rsquo;s name and then reply back.\nRequirements:\nAsk for user name Replies back with \u0026lsquo;Hi, {name}, nice to meet you!\u0026rsquo; The code:\nuse std::io; fn main() { println!(\u0026#34;What is your name?\u0026#34;); // Let\u0026#39;s variable \u0026#39;name\u0026#39; become mutable let mut name = String::new(); match io::stdin().read_line(\u0026amp;mut name) { Ok(_) =\u0026gt; { //trims the string let trim1 = name.trim(); println!(\u0026#34;Hi {}, nice to meet you.\u0026#34;, trim1); }, Err(error) =\u0026gt; println!(\u0026#34;error: {error}\u0026#34;), } } That\u0026rsquo;s all! Hehehe. Bai bai.\n","permalink":"https://sourfox.khmersite.net/p/2025/05/hithere/","summary":"\u003cp\u003eHi there! Today, instead of writing another python program,  I had wrote a rust program. In this code, the goal was to ask for user\u0026rsquo;s name and then reply back.\u003c/p\u003e\n\u003cp\u003eRequirements:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eAsk for user name\u003c/li\u003e\n\u003cli\u003eReplies back with \u0026lsquo;Hi, {name}, nice to meet you!\u0026rsquo;\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe code:\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003euse std::io;\n\nfn main() {\n    println!(\u0026#34;What is your name?\u0026#34;);\n    // Let\u0026#39;s variable \u0026#39;name\u0026#39; become mutable\n    let mut name = String::new();\n    match io::stdin().read_line(\u0026amp;mut name) {\n        Ok(_) =\u0026gt; {\n            //trims the string\n            let trim1 = name.trim();\n            println!(\u0026#34;Hi {}, nice to meet you.\u0026#34;, trim1);\n        },\n        Err(error) =\u0026gt; println!(\u0026#34;error: {error}\u0026#34;),\n    }\n}\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003eThat\u0026rsquo;s all! Hehehe. Bai bai.\u003c/p\u003e","title":"Hi there!"},{"content":"In my other blog post \u0026lsquo;Binary to Decimal\u0026rsquo;, I realized what if I had put in a different number than 1 and 0. I tried putting a 2 and the code still worked. So I will be sharing an updated version, so that you can only put in either 1 or 0. Else there will be an error.\n# make a new function def bintodeci(num): reverse = len(num) -1 exp = 0 total = 0 for index in range(reverse, -1, -1): # if each number is either 0 or 1 else it\u0026#39;ll print out an error. if num[index] in \u0026#39;01\u0026#39;: total += int(num[index]) * (2**exp) exp += 1 else: print(\u0026#34;Error: Invalid binary number\u0026#34;) return None # return the value return total # In case I want to import it if __name__ == \u0026#39;__main__\u0026#39;: print(f\u0026#39;The variable __name__ is {__name__}\u0026#39;) answer = bintodeci(\u0026#34;111\u0026#34;) print(answer) ","permalink":"https://sourfox.khmersite.net/p/2025/01/binary_to_decimal_updated/","summary":"\u003cp\u003eIn my other blog post \u0026lsquo;Binary to Decimal\u0026rsquo;, I realized what if I had put in a different number than 1 and 0. I tried putting a 2 and the code still worked. So I will be sharing an updated version, so that you can only put in either 1 or 0. Else there will be an error.\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-python\" data-lang=\"python\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"c1\"\u003e# make a new function\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"k\"\u003edef\u003c/span\u003e \u003cspan class=\"nf\"\u003ebintodeci\u003c/span\u003e\u003cspan class=\"p\"\u003e(\u003c/span\u003e\u003cspan class=\"n\"\u003enum\u003c/span\u003e\u003cspan class=\"p\"\u003e):\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e    \u003cspan class=\"n\"\u003ereverse\u003c/span\u003e \u003cspan class=\"o\"\u003e=\u003c/span\u003e \u003cspan class=\"nb\"\u003elen\u003c/span\u003e\u003cspan class=\"p\"\u003e(\u003c/span\u003e\u003cspan class=\"n\"\u003enum\u003c/span\u003e\u003cspan class=\"p\"\u003e)\u003c/span\u003e \u003cspan class=\"o\"\u003e-\u003c/span\u003e\u003cspan class=\"mi\"\u003e1\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e    \u003cspan class=\"n\"\u003eexp\u003c/span\u003e \u003cspan class=\"o\"\u003e=\u003c/span\u003e \u003cspan class=\"mi\"\u003e0\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e    \u003cspan class=\"n\"\u003etotal\u003c/span\u003e \u003cspan class=\"o\"\u003e=\u003c/span\u003e \u003cspan class=\"mi\"\u003e0\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e    \u003cspan class=\"k\"\u003efor\u003c/span\u003e \u003cspan class=\"n\"\u003eindex\u003c/span\u003e \u003cspan class=\"ow\"\u003ein\u003c/span\u003e \u003cspan class=\"nb\"\u003erange\u003c/span\u003e\u003cspan class=\"p\"\u003e(\u003c/span\u003e\u003cspan class=\"n\"\u003ereverse\u003c/span\u003e\u003cspan class=\"p\"\u003e,\u003c/span\u003e \u003cspan class=\"o\"\u003e-\u003c/span\u003e\u003cspan class=\"mi\"\u003e1\u003c/span\u003e\u003cspan class=\"p\"\u003e,\u003c/span\u003e \u003cspan class=\"o\"\u003e-\u003c/span\u003e\u003cspan class=\"mi\"\u003e1\u003c/span\u003e\u003cspan class=\"p\"\u003e):\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e        \u003cspan class=\"c1\"\u003e# if each number is either 0 or 1 else it\u0026#39;ll print out an error.\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e        \u003cspan class=\"k\"\u003eif\u003c/span\u003e \u003cspan class=\"n\"\u003enum\u003c/span\u003e\u003cspan class=\"p\"\u003e[\u003c/span\u003e\u003cspan class=\"n\"\u003eindex\u003c/span\u003e\u003cspan class=\"p\"\u003e]\u003c/span\u003e \u003cspan class=\"ow\"\u003ein\u003c/span\u003e \u003cspan class=\"s1\"\u003e\u0026#39;01\u0026#39;\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e            \u003cspan class=\"n\"\u003etotal\u003c/span\u003e \u003cspan class=\"o\"\u003e+=\u003c/span\u003e \u003cspan class=\"nb\"\u003eint\u003c/span\u003e\u003cspan class=\"p\"\u003e(\u003c/span\u003e\u003cspan class=\"n\"\u003enum\u003c/span\u003e\u003cspan class=\"p\"\u003e[\u003c/span\u003e\u003cspan class=\"n\"\u003eindex\u003c/span\u003e\u003cspan class=\"p\"\u003e])\u003c/span\u003e \u003cspan class=\"o\"\u003e*\u003c/span\u003e \u003cspan class=\"p\"\u003e(\u003c/span\u003e\u003cspan class=\"mi\"\u003e2\u003c/span\u003e\u003cspan class=\"o\"\u003e**\u003c/span\u003e\u003cspan class=\"n\"\u003eexp\u003c/span\u003e\u003cspan class=\"p\"\u003e)\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e            \u003cspan class=\"n\"\u003eexp\u003c/span\u003e \u003cspan class=\"o\"\u003e+=\u003c/span\u003e \u003cspan class=\"mi\"\u003e1\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e        \u003cspan class=\"k\"\u003eelse\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e            \u003cspan class=\"nb\"\u003eprint\u003c/span\u003e\u003cspan class=\"p\"\u003e(\u003c/span\u003e\u003cspan class=\"s2\"\u003e\u0026#34;Error: Invalid binary number\u0026#34;\u003c/span\u003e\u003cspan class=\"p\"\u003e)\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e            \u003cspan class=\"k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"kc\"\u003eNone\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e            \n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e    \u003cspan class=\"c1\"\u003e# return the value\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e    \u003cspan class=\"k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"n\"\u003etotal\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"c1\"\u003e# In case I want to import it\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"k\"\u003eif\u003c/span\u003e \u003cspan class=\"vm\"\u003e__name__\u003c/span\u003e \u003cspan class=\"o\"\u003e==\u003c/span\u003e \u003cspan class=\"s1\"\u003e\u0026#39;__main__\u0026#39;\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e     \u003cspan class=\"nb\"\u003eprint\u003c/span\u003e\u003cspan class=\"p\"\u003e(\u003c/span\u003e\u003cspan class=\"sa\"\u003ef\u003c/span\u003e\u003cspan class=\"s1\"\u003e\u0026#39;The variable __name__ is \u003c/span\u003e\u003cspan class=\"si\"\u003e{\u003c/span\u003e\u003cspan class=\"vm\"\u003e__name__\u003c/span\u003e\u003cspan class=\"si\"\u003e}\u003c/span\u003e\u003cspan class=\"s1\"\u003e\u0026#39;\u003c/span\u003e\u003cspan class=\"p\"\u003e)\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e     \u003cspan class=\"n\"\u003eanswer\u003c/span\u003e \u003cspan class=\"o\"\u003e=\u003c/span\u003e \u003cspan class=\"n\"\u003ebintodeci\u003c/span\u003e\u003cspan class=\"p\"\u003e(\u003c/span\u003e\u003cspan class=\"s2\"\u003e\u0026#34;111\u0026#34;\u003c/span\u003e\u003cspan class=\"p\"\u003e)\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e     \u003cspan class=\"nb\"\u003eprint\u003c/span\u003e\u003cspan class=\"p\"\u003e(\u003c/span\u003e\u003cspan class=\"n\"\u003eanswer\u003c/span\u003e\u003cspan class=\"p\"\u003e)\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e","title":"Binary to Decimal Updated"},{"content":"Hi, today I\u0026rsquo;m sharing a recursive funtion in python. Recursive in python means the \u0026lsquo;def\u0026rsquo; function to call itself. The goal is to sum up the numbers to the number I want. For example, if I put in 3:\n1 + 2 + 3 = 6 # def = makes a new function def sum(num): # if we have an \u0026#39;if\u0026#39;, we should also have an \u0026#39;else\u0026#39;. if num == 0: return 0 else: return sum(num - 1) + num print(sum(2)) Outcome:\n3 Dats all. Bai.\n","permalink":"https://sourfox.khmersite.net/p/2025/01/recursive_function/","summary":"\u003cp\u003eHi, today I\u0026rsquo;m sharing a recursive funtion in python. Recursive in python means the \u0026lsquo;def\u0026rsquo; function to call itself. The goal is to sum up the numbers to the number I want. For example, if I put in 3:\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003e1 + 2 + 3 = 6\n\u003c/code\u003e\u003c/pre\u003e\u003cpre tabindex=\"0\"\u003e\u003ccode\u003e# def = makes a new function\ndef sum(num):\n    # if we have an \u0026#39;if\u0026#39;, we should also have an \u0026#39;else\u0026#39;.\n    if num == 0:\n        return 0\n    else:\n        return sum(num - 1) + num\n\n\nprint(sum(2))\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003eOutcome:\u003c/p\u003e","title":"Recursive function"},{"content":"I\u0026rsquo;m sharing a program that converts binary to decimal in python.\n# make a new function def bintodeci(num): reverse = len(num) -1 exp = 0 total = 0 # range(start, stop, step) for digit in range(reverse, -1, -1): total += int(num[digit]) * (2**exp) exp += 1 # return the value return total answer = bintodeci(\u0026#34;11\u0026#34;) print(answer) sample output:\n10 bai.\n","permalink":"https://sourfox.khmersite.net/p/2025/01/binary_to_decimal/","summary":"\u003cp\u003eI\u0026rsquo;m sharing a program that converts binary to decimal in python.\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003e# make a new function\ndef bintodeci(num):\n    reverse = len(num) -1\n    exp = 0\n    total = 0\n    # range(start, stop, step)\n    for digit in range(reverse, -1, -1):\n        total += int(num[digit]) * (2**exp)\n        exp += 1\n    \n    # return the value\n    return total\n\n\nanswer = bintodeci(\u0026#34;11\u0026#34;)\nprint(answer)\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003esample output:\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003e10\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003ebai.\u003c/p\u003e","title":"Binary to Decimal"},{"content":"I\u0026rsquo;m sharing a wrapper program written in python to backup my files in my device using restic.\nimport subprocess restic_command = [\u0026#39;restic\u0026#39;, \u0026#39;backup\u0026#39;] backup = [\u0026#34;C:\\\\Users\\\\veronica\\\\ibisPaint\u0026#34;, \u0026#34;C:\\\\Users\\\\veronica\\\\Pictures\u0026#34;, \u0026#34;C:\\\\Users\\\\veronica\\\\Documents\u0026#34;] print(\u0026#34;List of directories to be backed up:\\n\u0026#34; ) #list the files that will be backed up. #enumerate = allows you to keep track of the number of iterations in a loop. for number, dir in enumerate(backup, start=1): print(f\u0026#34; {number}. {dir}\u0026#34;) # Or: print(\u0026#34; \u0026#34; + str(number) + \u0026#34;.\u0026#34;, letter ) # \\n makes a new line print(\u0026#34;\\nBackup process started...\\n\u0026#34;) # combines the lists together. backup_command = restic_command + backup restic = subprocess.run(backup_command, shell=True) The end. -w-\nReferences:\nhttps://www.simplilearn.com/tutorials/python-tutorial/enumerate-in-python#:~:text=list()%20method.-,What%20Does%20Enumerate%20Do%20in%20Python%3F,iterating%20over%20the%20iterable%20object.\nhttps://stackoverflow.com/questions/29811082/how-to-print-out-a-numbered-list-in-python-3\nhttps://stackoverflow.com/questions/19683779/subprocess-popen-how-to-pass-a-list-as-argument\nhttps://dev.to/charlesw001/execute-commands-from-the-command-line-in-a-python-program-3edn\n","permalink":"https://sourfox.khmersite.net/p/2024/12/create-restic-backup-program/","summary":"\u003cp\u003eI\u0026rsquo;m sharing a wrapper program written in python to backup my files in my device using restic.\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003eimport subprocess\n\nrestic_command = [\u0026#39;restic\u0026#39;, \u0026#39;backup\u0026#39;]\n\nbackup = [\u0026#34;C:\\\\Users\\\\veronica\\\\ibisPaint\u0026#34;, \u0026#34;C:\\\\Users\\\\veronica\\\\Pictures\u0026#34;, \u0026#34;C:\\\\Users\\\\veronica\\\\Documents\u0026#34;]\n\nprint(\u0026#34;List of directories to be backed up:\\n\u0026#34; )\n\n#list the files that will be backed up.\n#enumerate = allows you to keep track of the number of iterations in a loop.\nfor number, dir in enumerate(backup, start=1):\n    print(f\u0026#34;    {number}. {dir}\u0026#34;)\n#  Or: print(\u0026#34;    \u0026#34; + str(number) + \u0026#34;.\u0026#34;, letter )\n\n# \\n makes a new line\nprint(\u0026#34;\\nBackup process started...\\n\u0026#34;)\n\n# combines the lists together.\nbackup_command = restic_command + backup\n\nrestic = subprocess.run(backup_command, shell=True)\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003eThe end. -w-\u003c/p\u003e","title":"Create Restic Backup Program"},{"content":"Hallooo peeps! Last time, I made a new user on Linux but in this one, instead of just making a new user, I\u0026rsquo;ll alo be adding a name for the user and add it into the \u0026lsquo;wheel\u0026rsquo; group.\nHere are the requirements:\nUsername: cooldonkey Password: awesomedonkey24 Name of account: “Donkey” Group: \u0026lsquo;cooldonkey\u0026rsquo;, \u0026lsquo;wheel\u0026rsquo; (wheel group allows a user to run sudo command) The first thing I\u0026rsquo;ll do is making the user so we\u0026rsquo;ll use the sudo useradd. But instead of just using useradd, I\u0026rsquo;ll also add in an option called \u0026ndash;comment (-c). This will let me do number 3. Add a name for the user.\n$ sudo useradd --comment \u0026quot;Donkey\u0026quot; cooldonkey\nThe first and third requirement has been accomplished. Now to do requirement 2. The same thing like the last post, I\u0026rsquo;ll use sudo passwd.\n$ sudo passwd cooldonkey\nThe last requirement, assign cooldonkey to the \u0026lsquo;wheel\u0026rsquo; group. i\u0026rsquo;ll be using two more options. \u0026ndash;append and \u0026ndash;groups. The \u0026lsquo;append\u0026rsquo; will allow me to add cooldonkey to the group using \u0026ndash;groups to \u0026lsquo;wheel\u0026rsquo;.\n$ sudo usermod --append --groups wheel cooldonkey\nWelp, I\u0026rsquo;ve done all the requirements so now cooldonkey is all done! Thanks for reading. Goodbye.\nReference:\n3 basic Linux user management commands every sysadmin should know ","permalink":"https://sourfox.khmersite.net/p/2024/11/new-assignment/","summary":"\u003cp\u003eHallooo peeps! Last time, I made a new user on Linux but in this one, instead of just making a new user, I\u0026rsquo;ll alo be adding a name for the user and add it into the \u0026lsquo;wheel\u0026rsquo; group.\u003c/p\u003e\n\u003cp\u003eHere are the requirements:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eUsername: cooldonkey\u003c/li\u003e\n\u003cli\u003ePassword: awesomedonkey24\u003c/li\u003e\n\u003cli\u003eName of account: “Donkey”\u003c/li\u003e\n\u003cli\u003eGroup: \u0026lsquo;cooldonkey\u0026rsquo;, \u0026lsquo;wheel\u0026rsquo; (wheel group allows a user to run sudo command)\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eThe first thing I\u0026rsquo;ll do is making the user so we\u0026rsquo;ll use the \u003cstrong\u003esudo useradd\u003c/strong\u003e. But instead of just using \u003cstrong\u003euseradd\u003c/strong\u003e, I\u0026rsquo;ll also add in an option called \u003cstrong\u003e\u0026ndash;comment (-c)\u003c/strong\u003e. This will let me do number 3. Add a name for the user.\u003c/p\u003e","title":"Create a new user account on Linus Server Take 2"},{"content":"Hellooo! Let\u0026rsquo;s learn how to make a new account on a Linux Server.\nThe first command we\u0026rsquo;ll be using is \u0026lsquo;useradd\u0026rsquo;. That command allows you to make a new account.\nThis is how it goes:\nsudo useradd test2\nNow that the account username had been created. Now we have to make a password for it. To do that, we\u0026rsquo;ll use the command \u0026lsquo;sudo passwd (username)\u0026rsquo; Like this:\nsudo passwd test2\nThen, you just type whatever password you want it to be. That\u0026rsquo;s all to making a new account.\nThe End.\n","permalink":"https://sourfox.khmersite.net/p/2024/11/new-account/","summary":"\u003cp\u003eHellooo! Let\u0026rsquo;s learn how to make a new account on a Linux Server.\u003c/p\u003e\n\u003cp\u003eThe first command we\u0026rsquo;ll be using is \u0026lsquo;useradd\u0026rsquo;. That command allows you to make a new account.\u003c/p\u003e\n\u003cp\u003eThis is how it goes:\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003esudo useradd test2\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003eNow that the account username had been created. Now we have to make a password for it. To do that, we\u0026rsquo;ll use the command \u0026lsquo;sudo passwd (username)\u0026rsquo; Like this:\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003esudo passwd test2\u003c/code\u003e\u003c/p\u003e","title":"How to make a new account on a Linux Server"},{"content":"Today, I was given an assignment to write a program to implement an atm dispenser in the following notes: 100, 50, 20, 10, and 5. If the amount is not a multiply of 5, the atm will return a list of 0.\nIn the code are short explanations of why I used it.\n# asks the customer to enter an amount of number. atm = int(input(\u0026#34;Enter an amount in a multiple of 5: \u0026#34;)) # This takes in a amount parameter which is the input from the user and return an array of bills in the following orders: [$100, $50, $20, $10, $5]. def dispenser(amount): # if statement to check if number entered is divisible by 5. If not, return with 0, if yes, continue code. if atm % 5 != 0: return [0, 0, 0, 0, 0] result = [] bill_types = [100, 50, 20, 10, 5] # starts with the starting amount being divided by each number in bill_types. for each_note in bill_types: note_counts = amount // each_note result.append(note_counts) # get the remainder and overwrite the previous. amount = amount % each_note return result # The code below is what will be given back as a sentence to the customer. print(f\u0026#34;You entered ${atm}: {dispenser(atm)}\u0026#34;) ","permalink":"https://sourfox.khmersite.net/p/2024/8/atm/","summary":"\u003cp\u003eToday, I was given an assignment to write a program to implement an atm dispenser in the following notes: 100, 50, 20, 10, and 5. If the amount is not a multiply of 5, the atm will return a list of 0.\u003c/p\u003e\n\u003cp\u003eIn the code are short explanations of why I used it.\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003e# asks the customer to enter an amount of number.\natm = int(input(\u0026#34;Enter an amount in a multiple of 5: \u0026#34;))\n\n# This takes in a amount parameter which is the input  from the user and return an array of bills in the following orders: [$100, $50, $20, $10, $5]. \ndef dispenser(amount):\n    \n    # if statement to check if number entered is divisible by 5. If not, return with 0, if yes, continue code.\n    if atm % 5 != 0:\n        return [0, 0, 0, 0, 0]\n    \n    result = []\n    bill_types = [100, 50, 20, 10, 5]\n\n# starts with the starting amount being divided by each number in bill_types.\n    for each_note in bill_types:\n        note_counts = amount // each_note\n        result.append(note_counts)\n\n        # get the remainder and overwrite the previous.\n        amount = amount % each_note\n\n    return result\n\n# The code below is what will be given back as a sentence to the customer.\nprint(f\u0026#34;You entered ${atm}: {dispenser(atm)}\u0026#34;)\n\u003c/code\u003e\u003c/pre\u003e","title":"Atm Bill Dispenser"},{"content":"In this assignment, it\u0026rsquo;ll be finding the GCD(Greatest Common Divisor). This means I need to write a program to find the GCD of two numbers. Below, I have written the program and next to the hashtags are just a sentence that\u0026rsquo;ll explain to you what each part of the code is doing.\n#The two variables \u0026#39;num\u0026#39; and \u0026#39;ber\u0026#39; will be where the inputs will be stored in. When it starts it will show \u0026#39;(num)a: \u0026#39; and you\u0026#39;ll have to put a number in. This goes the same for \u0026#39;(ber)b: \u0026#39; num = int(input(\u0026#34;a: \u0026#34;)) ber = int(input(\u0026#34;b: \u0026#34;)) #Then once the variable has gotten their information, they will go through this: def gcd(num, ber): if ber == 0: return num else: return gcd(ber, num % ber) #And last, it\u0026#39;ll gather their answer and print it for you as a sentence. print(f\u0026#34;The GCD {num}, {ber} is {gcd(num, ber)}.\u0026#34;) That\u0026rsquo;s all today. Bye!\n","permalink":"https://sourfox.khmersite.net/p/2024/7/assignment_gcd/","summary":"\u003cp\u003eIn this assignment, it\u0026rsquo;ll be finding the GCD(Greatest Common Divisor). This means I need to write a program to find the GCD of two numbers. Below, I have written the program and next to the hashtags are just a sentence that\u0026rsquo;ll explain to you what each part of the code is doing.\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003e#The two variables \u0026#39;num\u0026#39; and \u0026#39;ber\u0026#39; will be where the inputs will be stored in. When it starts it will show \u0026#39;(num)a: \u0026#39; and you\u0026#39;ll have to put a number in. This goes the same for \u0026#39;(ber)b: \u0026#39;\n\nnum = int(input(\u0026#34;a: \u0026#34;))\nber = int(input(\u0026#34;b: \u0026#34;))\n\n#Then once the variable has gotten their information, they will go through this: \n\ndef gcd(num, ber):\n    if ber == 0:\n        return num\n    else:\n        return gcd(ber, num % ber)\n    \n#And last, it\u0026#39;ll gather their answer and print it for you as a sentence.\n\nprint(f\u0026#34;The GCD {num}, {ber} is {gcd(num, ber)}.\u0026#34;)\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003eThat\u0026rsquo;s all today. Bye!\u003c/p\u003e","title":"Finding the GCD of two numbers"},{"content":"Today, I just got back to python after a few months. So when coming back, I got an assignment. My assignment was to check if a year is a leap year. In the assignment, it also gave hints. These were the hints:\nA leap year is a calendar year that contains an additional day (February 29th) compared to a common year. It occurs once every four year. s This is how you can determine if a year is a leap year or not:\nif (year is not divisible by 4) then (it is a common year).\nelse if (year is not divisible by 100) then (it is a leap year)\nelse if (year is not divisible by 400) then (it is a common year)\nelse (it is a leap year)\nBelow the bolded words are the main hints. It basically told us how to do it. Can you see it?\nIf not, what it is trying to say is that we will have to use the if statement. Below, I have typed out how to do it, also using the comments to explain simply what each part of the code is doing. (Basically the words next to the \u0026lsquo;hashtag.\u0026rsquo;)\n#This will bring in current datetime import datetime # Ask the user to \u0026#39;enter a year\u0026#39; year_input = input(\u0026#34;Enter a year: \u0026#34;) year = int(year_input) is_leap_year = False # if (year is not divisible by 4) then (it is a common year). if year % 4 != 0: is_leap_year = False # else if (year is not divisible by 100) then (it is a leap year) elif year % 100 != 0: is_leap_year = True # else if (year is not divisible by 400) then (it is a common year) elif year % 400 != 0: is_leap_year = False else: is_leap_year = True # Set the tense to be as \u0026#39;is\u0026#39;, \u0026#39;was\u0026#39;, or \u0026#39;will be\u0026#39; depending on # the given year to_be = \u0026#39;is\u0026#39; # default #1. find the current year today = datetime.date.today() current_year = today.year #2. Compare with the input year and current year if current_year \u0026gt; year: to_be = \u0026#39;was\u0026#39; elif current_year \u0026lt; year: to_be = \u0026#39;will\u0026#39; else: to_be = \u0026#39;is\u0026#39; # create friendly output for printing out if is_leap_year: if year \u0026gt; current_year: leap_year_output = \u0026#34;will be\u0026#34; else: leap_year_output = f\u0026#34;{to_be}\u0026#34; else: # future input if current_year \u0026lt; year: leap_year_output = \u0026#34;will not be\u0026#34; else: leap_year_output = f\u0026#34;{to_be} not\u0026#34; #The sentence it\u0026#39;ll print out back to the user. print(f\u0026#34;The year {year} {leap_year_output} a leap year.\u0026#34;) And there you have it! See ya next time! :\u0026gt;\n","permalink":"https://sourfox.khmersite.net/p/2024/5/assignment_9/","summary":"\u003cp\u003eToday, I just got back to python after a few months. So when coming back, I got an assignment. My assignment was to \u003cem\u003echeck if a year is a leap year.\u003c/em\u003e In the assignment, it also gave hints. These were the hints:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003cp\u003eA leap year is a calendar year that contains an additional day (February 29th) compared to a common year. It occurs once every four year.\ns\n\u003cstrong\u003eThis is how you can determine if a year is a leap year or not:\u003c/strong\u003e\u003c/p\u003e","title":"Check if a year is a leap year"},{"content":"Halo! Today I have to make a python program that meets these conditions:\nWrite a Python program that creates and print a dictionary that maps each element in a list to its corresponding frequency (how many times it occurs in the list).\nThe test should be case-sensitive. Therefore, “A” should not be considered the same element as “a”.\nI think for today, I\u0026rsquo;m just going to make it short. Yea\u0026hellip;\nSo this is how you do it-\nele = [\u0026#39;a\u0026#39;, \u0026#39;a\u0026#39;, \u0026#39;b\u0026#39;, \u0026#39;c\u0026#39;, \u0026#39;a\u0026#39;, \u0026#39;b\u0026#39;] dict = {} for i in ele: if i not in dict: dict[i] = 1 else: dict[i] = dict[i] + 1 print(dict) Output -\n{\u0026#39;a\u0026#39;: 3, \u0026#39;b\u0026#39;: 2, \u0026#39;c\u0026#39;: 1} The end\u0026hellip;\no-o\n","permalink":"https://sourfox.khmersite.net/p/2024/2/assignment-8/","summary":"\u003cp\u003eHalo! Today I have to make a python program that meets these conditions:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cp\u003eWrite a Python program that creates and print a dictionary that maps each element in a list to its corresponding frequency (how many times it occurs in the list).\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eThe test should be case-sensitive. Therefore, “A” should not be considered the same element as “a”.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eI think for today, I\u0026rsquo;m just going to make it short. Yea\u0026hellip;\u003c/p\u003e","title":"Make a Frequency Dictionary From the Elements Of a List "},{"content":"Halooo! Today I\u0026rsquo;ll be teaching you how to find the second largest value in a list. The conditions -\nWrite a Python program that prints the second largest value in a list.\nIf the list is empty or only has one element, print None.SSS\nTo do this, we\u0026rsquo;ll have to make a list and then sort it and then we use the if statement and else.\nInput:\nlista = [1, 4, 8, 9, 100, 200, 30] lista.sort() if len(lista) \u0026gt; 1: print(lista[-2]) else: print(\u0026#34;None\u0026#34;) Output -\n100 ","permalink":"https://sourfox.khmersite.net/p/2024/2/assignment-7/","summary":"\u003cp\u003eHalooo! Today I\u0026rsquo;ll be teaching you how to find the second largest value in a list. The conditions -\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cp\u003eWrite a Python program that prints the second largest value in a list.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eIf the list is empty or only has one element, print None.SSS\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eTo do this, we\u0026rsquo;ll have to make a list and then sort it and then we use the if statement and else.\u003c/p\u003e\n\u003cp\u003eInput:\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003elista = [1, 4, 8, 9, 100, 200, 30]\nlista.sort()\n\nif len(lista) \u0026gt; 1:\n    print(lista[-2])\nelse:\n    print(\u0026#34;None\u0026#34;)\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003eOutput -\u003c/p\u003e","title":"Finding the Second Largest Value in a List"},{"content":"Haloo people! How long has it been since I\u0026rsquo;ve done a blog post? Welp, I\u0026rsquo;ve finished my long break and now it\u0026rsquo;s time to get back to work. Today, I\u0026rsquo;ll be writing a python program that prints the elements of one list (a) that are not in the other list (b) as a list.\nMy conditions are:\nIf the lists have the same elements, it will print an empty list. If the first list (a) is an empty list, it\u0026rsquo;ll print an empty list. An example -\nList a [1, 2, 3, 4] List b [1, 2] Output [3, 4] 1. Making a List First, I\u0026rsquo;ll be making 2 lists. List a and list b.\na = [1, 2, 3, 4] b = [1, 2] And then an empty list for the output.\noutput = [] 2. For loops Now it\u0026rsquo;s time to make a for-loop.\nfor i in a: if i not in b: output.append(i) 3. Adding the final piece Now to add the final piece. The function print. Or else, you won\u0026rsquo;t see ze final piece.\nprint(output) 4. Putting them together When putting everything together, you\u0026rsquo;ll get:\nInput -\na = [1, 2, 3, 4] b = [1,2] output = [] for i in a: if i not in b: output.append(i) print(output) So then my output will be:\n[3, 4] So there you go!\n","permalink":"https://sourfox.khmersite.net/p/2024/2/assignment-6/","summary":"\u003cp\u003eHaloo people! How long has it been since I\u0026rsquo;ve done a blog post? Welp, I\u0026rsquo;ve finished my long break and now it\u0026rsquo;s time to get back to work. Today, I\u0026rsquo;ll be writing a python program that prints the elements of one list (a) that are not in the other list (b) as a list.\u003c/p\u003e\n\u003cp\u003eMy conditions are:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eIf the lists have the same elements, it will print an empty list.\u003c/li\u003e\n\u003cli\u003eIf the first list (a) is an empty list, it\u0026rsquo;ll print an empty list.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eAn example -\u003c/p\u003e","title":"Finding elements not in list"},{"content":"It\u0026rsquo;s been a long time since i\u0026rsquo;ve done a blog post. I wonder why\u0026hellip;.\nWelp, today I\u0026rsquo;ve got an assignment, today\u0026rsquo;s one is to write a python program that prints a version of the strings with all commas replaced by dots. Like this.\nExample -\nInput Output \u0026#34;Hello, World!\u0026#34; \u0026#34;Hello. World!\u0026#34; \u0026#34;725,000\u0026#34; \u0026#34;725.000\u0026#34; First, I\u0026rsquo;m going to do the 1st one. I\u0026rsquo;m going to assign it to a variable called string.\nstring = \u0026#39;Hello, World!\u0026#39; Then I\u0026rsquo;m going to use the print and replace function.\nprint(string.replace(\u0026#39;,\u0026#39;, \u0026#39;.\u0026#39;)) Now the comma would be replaced by dots.\nFinal -\nstring = \u0026#39;Hello, World!\u0026#39; print(string.replace(\u0026#39;,\u0026#39;, \u0026#39;.\u0026#39;)) The same thing goes with the \u0026lsquo;725,000\u0026rsquo;\nstring = \u0026#39;725,000\u0026#39; print(string.replace(\u0026#39;,\u0026#39;, \u0026#39;.\u0026#39;)) And there you go.\nBye bye! =D\n","permalink":"https://sourfox.khmersite.net/p/2023/12/switching-commas/","summary":"\u003cp\u003eIt\u0026rsquo;s been a long time since i\u0026rsquo;ve done a blog post. I wonder why\u0026hellip;.\u003c/p\u003e\n\u003cp\u003eWelp, today I\u0026rsquo;ve got an assignment, today\u0026rsquo;s one is to write a python program that prints a version of the strings with all commas replaced by dots. Like this.\u003c/p\u003e\n\u003cp\u003eExample -\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003e  Input               Output\n\u0026#34;Hello, World!\u0026#34;      \u0026#34;Hello. World!\u0026#34;\n\u0026#34;725,000\u0026#34;            \u0026#34;725.000\u0026#34;\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003eFirst, I\u0026rsquo;m going to do the 1st one. I\u0026rsquo;m going to assign it to a variable called string.\u003c/p\u003e","title":"Commas replaced by dots"},{"content":"Today I was very bored so I checked my bonus assignments and I got this.\nWrite a Python program that adds a new key-value pair to a dictionary only if the key doesn\u0026rsquo;t exist already.\nIf the key-value pair exists in the dictionary, do not update the existing value. The dictionary should not be modified in this case.\nStore the new key in the new_key variable and the new value in the new_value variable. Print the final value of the dictionary.\noh btw, I\u0026rsquo;m not going to explain this one\u0026hellip;. although I\u0026rsquo;ll make steps\u0026hellip;\nSteps:\nMake dictionary Make new variables use if statement and append print dictionary. Ta da:\ndict = {\u0026#34;Jan\u0026#34;: 1, \u0026#34;Feb\u0026#34;: 2, \u0026#34;Mar\u0026#34;: 3} new_key = \u0026#34;Feb\u0026#34; new_value = 4 if new_key not in dict: dict[new_key] = new_value print(dict) Thank you.\n","permalink":"https://sourfox.khmersite.net/p/2023/11/dictionary/","summary":"\u003cp\u003eToday I was very bored so I checked my bonus assignments and I got this.\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003cp\u003eWrite a Python program that adds a new key-value pair to a dictionary only if the key doesn\u0026rsquo;t exist already.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eIf the key-value pair exists in the dictionary, do not update the existing value. The dictionary should not be modified in this case.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eStore the new key in the new_key variable and the new value in the new_value variable.\nPrint the final value of the dictionary.\u003c/p\u003e","title":"Bonus assignment: Challenge Add a Key-Value Pair Only if the Key is Not in the Dictionary "},{"content":"The next one I\u0026rsquo;ll actually explain thoroughly.\nSo I had enough time to make another program. This time I had to meet the condtitions:\nWrite a Python program that checks if a key exists in a dictionary or not. If the key exists in the dictionary, print True. Else, print False. The key should be stored in the variable key. Here is how I did it:\nInput:\ndict = {\u0026#34;toy\u0026#34;: \u0026#34;dino\u0026#34;, \u0026#34;sport\u0026#34;: \u0026#34;soccer\u0026#34;, \u0026#34;food\u0026#34;: \u0026#34;ramen\u0026#34;} key = \u0026#34;toy\u0026#34; if key in dict: print(True) else: print(False) Output:\nTrue This is a shortcut:\nprint(dict.get(key) != None) Which prints the same output.\nBye! See ya next time or maybe not\u0026hellip;\n","permalink":"https://sourfox.khmersite.net/p/2023/11/check-if-a-key-is-in-a-dictionary/","summary":"\u003cp\u003e\u003cem\u003eThe next one I\u0026rsquo;ll actually explain thoroughly.\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eSo I had enough time to make another program. This time I had to meet the condtitions:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003eWrite a Python program that checks if a key exists in a dictionary or not.\n \nIf the key exists in the dictionary, print True. Else, print False.\n\nThe key should be stored in the variable key.\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eHere is how I did it:\u003c/p\u003e\n\u003cp\u003eInput:\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003edict = {\u0026#34;toy\u0026#34;: \u0026#34;dino\u0026#34;, \u0026#34;sport\u0026#34;: \u0026#34;soccer\u0026#34;, \u0026#34;food\u0026#34;: \u0026#34;ramen\u0026#34;}\nkey = \u0026#34;toy\u0026#34;\nif key in dict:\n    print(True)\nelse:\n    print(False)\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003eOutput:\u003c/p\u003e","title":"Check if a Key Is in a Dictionary"},{"content":"Today I was very bored, and I decided to do programming! I\u0026rsquo;m going to make a multiplication table!\nWhat I\u0026rsquo;m going to to:\nDo input and int assigned to a variable Use while loop Use for loop Make it pretty Step 1: First I\u0026rsquo;m going to make a variable called \u0026ldquo;num\u0026rdquo; and them use input to ask the person a question to grab info from. And I\u0026rsquo;m salso going to use \u0026ldquo;int\u0026rdquo; to make the string a integer.\nLike this:\nnum = input(\u0026#34;Give me a number between 1 and 12: \u0026#34;) Now to step 2.\nStep 2: Next, I\u0026rsquo;m going to use while loops! Like this:\nwhile 1 \u0026gt; num or num \u0026gt; 12: num = int(input(\u0026#34;Please enter a number between 1 and 12: \u0026#34;)) Step 3: For loops. So that I can print the multiplication table.\nfor item in range(1, 13): print(f\u0026#34; {num} x {item:2d} = {num*item:3d} \u0026#34;) MAKE IT PRETTY! print(\u0026#34;----------------------------------------------------\u0026#34;) for item in range(1, 13): print(f\u0026#34; {num} x {item:2d} = {num*item:3d} \u0026#34;) print(\u0026#34;----------------------------------------------------\u0026#34;) Final: Input:\nnum = int(input(\u0026#34;Give me a number between 1 and 12: \u0026#34;)) while 1 \u0026gt; num or num \u0026gt; 12: num = int(input(\u0026#34;Please enter a number between 1 and 12: \u0026#34;)) print(\u0026#34;----------------------------------------------------\u0026#34;) for item in range(1, 13): print(f\u0026#34; {num} x {item:2d} = {num*item:3d} \u0026#34;) print(\u0026#34;----------------------------------------------------\u0026#34;) Output:\nnum = int(input(\u0026#34;Give me a number between 1 and 12: \u0026#34;)) while 1 \u0026gt; num or num \u0026gt; 12: num = int(input(\u0026#34;Please enter a number between 1 and 12: \u0026#34;)) print(\u0026#34;----------------------------------------------------\u0026#34;) for item in range(1, 13): print(f\u0026#34; {num} x {item:2d} = {num*item:3d} \u0026#34;) print(\u0026#34;----------------------------------------------------\u0026#34;) Notice: Example if I put 3\nI\u0026rsquo;m pretty sure you didn\u0026rsquo;t learn that much from this. Maybe the next one I do, I\u0026rsquo;ll explain thoroughly.\nBye!\n","permalink":"https://sourfox.khmersite.net/p/2023/11/multiplication-table/","summary":"\u003cp\u003eToday I was very bored, and I decided to do programming! I\u0026rsquo;m going to make a multiplication table!\u003c/p\u003e\n\u003cp\u003eWhat I\u0026rsquo;m going to to:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eDo input and int assigned to a variable\u003c/li\u003e\n\u003cli\u003eUse while loop\u003c/li\u003e\n\u003cli\u003eUse for loop\u003c/li\u003e\n\u003cli\u003eMake it pretty\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch3 id=\"step-1\"\u003eStep 1:\u003c/h3\u003e\n\u003cp\u003eFirst I\u0026rsquo;m going to make a variable called \u0026ldquo;num\u0026rdquo; and them use input to ask the person a question to grab info from. And I\u0026rsquo;m salso going to use \u0026ldquo;int\u0026rdquo; to make the string a integer.\u003c/p\u003e","title":"Multiplication table"},{"content":"Today I had to do another assignment which is to create a python program which prints the elements of a list followed by their corresponding indices. Each element and its index must be on the same line seperated by a space. And if the list is empty, print \u0026ldquo;Empty List\u0026rdquo;.\nI\u0026rsquo;m going to make a list called num and put 1 to 4 inside.\nnum = [1, 2, 3, 4] Then I\u0026rsquo;ll use the if statement to do:\nif len(num) == 0: print(\u0026#34;Empty List\u0026#34;) So this will check if the list is empty first. But if it isn\u0026rsquo;t, I\u0026rsquo;ll use else to print out something which is the elements and index. After else, I\u0026rsquo;ll use for loop to print out the elements and index.\nelse: for i in range(len(num)): print(f\u0026#34;{num[i]} {i}\u0026#34;) Or:\nelse: for i in range(len(num)): print(num[i], i) So putting them together, I\u0026rsquo;ll get:\nInput:\nnum = [1, 2, 3, 4] if len(num) == 0: print(\u0026#34;Empty List\u0026#34;) else: for i in range(len(num)): print(f\u0026#34;{num[i]} {i}\u0026#34;) Or:\nnum = [1, 2, 3, 4] if len(num) == 0: print(\u0026#34;Empty List\u0026#34;) else: for i in range(len(num)): print(num[i], i) Output:\n1 0 2 1 3 2 4 3 Now I\u0026rsquo;m going to make an empty list and try see if it works.\nInput:\nemp = [] if len(num) == 0: print(\u0026#34;Empty List\u0026#34;) else: for i in range(len(num)): print(num[i], i) Output:\nEmpty List And it works!\nBONUS!!! This time I\u0026rsquo;m going to use a funtion called enumerate(). But I won\u0026rsquo;t do the empty list thing.\nfor count, item in enumerate(num): print(f\u0026#34;{item} {count}\u0026#34;) And there you go. Byeeeeee! Be ready for my next post\u0026hellip;\nReference:\nhttps://www.w3schools.com/python/ref_func_range.asp https://www.programiz.com/python-programming/methods/built-in/enumerate ","permalink":"https://sourfox.khmersite.net/p/2023/11/assignment-5/","summary":"\u003cp\u003eToday I had to do another assignment which is to create a python program which prints the elements of a list followed by their corresponding indices. Each element and its index must be on the same line seperated by a space. And if the list is empty, print \u003cstrong\u003e\u0026ldquo;Empty List\u0026rdquo;\u003c/strong\u003e.\u003c/p\u003e\n\u003cp\u003eI\u0026rsquo;m going to make a list called num and put 1 to 4 inside.\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003enum = [1, 2, 3, 4]\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003eThen I\u0026rsquo;ll use the \u003cstrong\u003eif\u003c/strong\u003e statement to do:\u003c/p\u003e","title":"Assignment 5: Elements and Indices"},{"content":"I was given an assignment for the fourth time. My goal was to write a python program that checks if a list is empty or not. If the list is empty, then it\u0026rsquo;ll print empty, if not, it\u0026rsquo;ll print not empty.\nI\u0026rsquo;m going to start with an empty list.\nemp = [] So that I can start the next step. I\u0026rsquo;m going to use\nif statement len() else print() When using if, there must be a condition met. My condition is:\nemp == 0 But there\u0026rsquo;s somthing wrong. emp is a variable assigned to an empty list. An empty list has nothing in it which equals 0. So how come? I can\u0026rsquo;t compare a list with an integer. Like how? This can be a common mistake.\nSo instead, we can do the len() of emp instead. Like this:\nlen(emp) == 0 Here is the code:\nemp = [] if len(emp) == 0: print(\u0026#34;empty\u0026#34;) else: print(\u0026#34;not empty\u0026#34;) The End for now\u0026hellip;\n(JK)\n","permalink":"https://sourfox.khmersite.net/p/2023/10/assignment-4/","summary":"\u003cp\u003eI was given an assignment for the fourth time. My goal was to write a python program that checks if a list is empty or not. If the list is empty, then it\u0026rsquo;ll print \u003cstrong\u003eempty\u003c/strong\u003e, if not, it\u0026rsquo;ll print \u003cstrong\u003enot empty\u003c/strong\u003e.\u003c/p\u003e\n\u003cp\u003eI\u0026rsquo;m going to start with an empty list.\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003eemp = []\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003eSo that I can start the next step. I\u0026rsquo;m going to use\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eif statement\u003c/li\u003e\n\u003cli\u003elen()\u003c/li\u003e\n\u003cli\u003eelse\u003c/li\u003e\n\u003cli\u003eprint()\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eWhen using if, there must be a condition met. My condition is:\u003c/p\u003e","title":"Assignment 4: Checking if a list is empty"},{"content":"Today, I was given another assignment. (Which I wasn\u0026rsquo;t expecting.) Today\u0026rsquo;s assignment was to write a python program which had to meet the conditions:\nWrite a Python proram that multiplies all the items in a list by the value of the variable factor.\nThe program must print the list as the output.\nThe program should allow multiplying the variable factor by a string in case the list contains strings.\nYou may assume that the value of factor will be a positive integer.\nI\u0026rsquo;ll be doing this with positive integers and string. For positive integers, I\u0026rsquo;ll be using the numbers 1, 2, 3, 4 and multiply it by 3 to get the output:\n[3, 6, 9, 12] And then for the string, I\u0026rsquo;m going to use a, b, c, d and then mutiply it by 2 to get the output:\n[aa, bb, cc, dd] Using positive integers First, I have to find out what function I\u0026rsquo;m going to use. In my head, I know what I\u0026rsquo;m going to use. I\u0026rsquo;m going to use:\nlists\nfor - loops\nappend\nprint\nNow I have to think of a plan which I already know what I\u0026rsquo;m going to do. I\u0026rsquo;m going to:\nMake a list called num_list.\nThen make another list called factor.\nThen make an empty list called output\nAfter making my lists, I\u0026rsquo;m going to use for loop\nAnd on the last step, I\u0026rsquo;m then going to use the print function to print the output.\nSo first, I make a list called num_lists to put the numbers 1, 2, 3, 4. So I do it like this:\nnum_lists = [1, 2, 3, 4] Now to the second step. Make another list called factor so that I can use it to multiply with num_lists each number.\nIn factor, I\u0026rsquo;m going to put the number I want to multiply with num_lists. So I\u0026rsquo;m going to put 3:\nfactor = 3 After my 2nd step, I\u0026rsquo;m going to my 3rd step which is to make another list but empty. This is so because I\u0026rsquo;m going to use append to add more items later.\noutput = [] I\u0026rsquo;m finally done with three steps. :D Just two more steps\u0026hellip;\nFourth step: For loops. I\u0026rsquo;m going to always start with for and then the variable as always for me, i but it can be anything else. Next I\u0026rsquo;m going to write my variable and end with colon:\nfor i in num_lists: Then when I press enter, there should be the three dots. If so, then I\u0026rsquo;m on the right track so I\u0026rsquo;ll do the indented space (four space).\n... (here u write) Now after my indented, I\u0026rsquo;m going to finally use the function append. I\u0026rsquo;m going to put the variable output and then append like:\noutput.append() Because I want to add things in the output list. In the parenthesis, I\u0026rsquo;m going to do i * factor since I want each number in num_lists to multiply three times using out factor.\n... output.append(i*factor) After that, I am finally done with the step for loops\nNow to the last one which is probably the easiest. All I have to do is now to print the variable output.\nprint(output) And putting that together, I make:\nnum_lists = [1, 2, 3, 4] factor = 3 output = [] for i in num_lists: ... output.append(i*factor) ... print(output) Which print my goal:\n[3, 6, 9, 12] Yay! :D I\u0026rsquo;ve finished half of this\u0026hellip; \u0026lsquo;_\u0026rsquo;\nUsing String Great, I\u0026rsquo;m running out of time right now. What do I do now? Oh wait, I just remembered, I have a shorter way to do this. Instead, I\u0026rsquo;m going to put almost everything in one variable.\nSo I\u0026rsquo;m going to make my new list:\nstr_list = [\u0026#39;a\u0026#39;, \u0026#39;b\u0026#39;, \u0026#39;c\u0026#39;] Then I\u0026rsquo;m going to make another list called factor and then add instead of 3, I\u0026rsquo;m going to add 2.\nfactor = 2 After that, I\u0026rsquo;ll make one more list called output but instead of making it empty, I\u0026rsquo;m going to do s * factor so that it\u0026rsquo;ll iterate and times it with 2 in the str_list. And then do the mini for loops by just doing the first part.\noutput = [s*factor for s in str_lists] And now the print:\nprint(output) And so when putting everything together, I get:\nstr_list = [\u0026#39;a\u0026#39;, \u0026#39;b\u0026#39;, \u0026#39;c\u0026#39;] factor = 2 output = [s*factor for s in str_lists] print(output) Which gives the output I want:\n[\u0026#39;aa\u0026#39;, \u0026#39;bb\u0026#39;, \u0026#39;cc\u0026#39;] Finishing up I\u0026rsquo;ve finally finished with everything. I hope you liked it. Thanks for reading! :D\n","permalink":"https://sourfox.khmersite.net/p/2023/10/assignment-3/","summary":"\u003cp\u003eToday, I was given another assignment. (Which I wasn\u0026rsquo;t expecting.) Today\u0026rsquo;s assignment was to write a python program which had to meet the conditions:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cp\u003eWrite a Python proram that multiplies all the items in a list by the value of the variable factor.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eThe program must print the list as the output.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eThe program should allow multiplying the variable factor by a string in case the list contains strings.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eYou may assume that the value of factor will be a positive integer.\u003c/p\u003e","title":"Assignment 3: Doubling "},{"content":"Today, I was given an assignment. My assignment wanted me to write a Python program that pints the length of a string.\nThis is what I had to print out:\nThe length of \u0026#34;\u0026#34; is 0. The length of \u0026#34;H\u0026#34; is 1. The length of \u0026#34;Hello\u0026#34; is 5. The length of \u0026#34;Amazing\u0026#34; is 7. To do this, I have a plan in my mind which is:\nStep 1. Find out what I\u0026rsquo;m going to use.\nStep 2. Write it out.\nStep 3. Finishing up.\n1. Functions I\u0026rsquo;m going to use I\u0026rsquo;ve got 3 functions I want to use. I\u0026rsquo;m going to use print, len, and f string. My reasons:\nprint so that I print out what I want to type.\nlen because I want to type the length of what I\u0026rsquo;m going to type.\nf string so that I join the things together.\n2. Writing it out I\u0026rsquo;m going to start with the print funciton and then add the parenthesis. Inside it, I\u0026rsquo;ll add the f string at the front and then the single \u0026rsquo;\u0026rsquo; quotation marks instead of the double because what I want to print has double quotation mark. If I just do double quotation marks, the program doesn\u0026rsquo;t know which belongs to who, so I split up. In the single quotation mark, I\u0026rsquo;m going to write: The length of and then put the double quotation marks after and then write is.\nSo far this is how it looks like:\nprint(f\u0026#39;The length of \u0026#34;\u0026#34; is\u0026#39;) Reminder: I\u0026rsquo;m just going to do the first one.\nAfter the is, I use the squiggly brackets because I\u0026rsquo;ve got the f string. Inside the squiggly brackets ({}), I\u0026rsquo;m got to use the function len to find out the length of \u0026quot;\u0026quot; and then after the squiggly brackets, I\u0026rsquo;m going to put a full stop to end the sentence.\nStep 3. Finishing up. So therefore, this is what it\u0026rsquo;ll print:\nprint(f\u0026#39;The length of \u0026#34;\u0026#34; is {len(\u0026#34;\u0026#34;)}.\u0026#39;) I do this for the whole thing but changing just a bit. So this is what I\u0026rsquo;ll print after:\nInput:\nprint(f\u0026#39;The length of \u0026#34;\u0026#34; is {len(\u0026#34;\u0026#34;)}.\u0026#39;) print(f\u0026#39;The length of \u0026#34;H\u0026#34; is {len(\u0026#34;H\u0026#34;)}. \u0026#39;) print(f\u0026#39;The length \u0026#34;Hello\u0026#34; is {len(\u0026#34;Hello\u0026#34;)}.\u0026#39;) print(f\u0026#39;The length \u0026#34;Amazing\u0026#34; is {len(\u0026#34;Amazing\u0026#34;)}.\u0026#39;) Output:\nThe length of \u0026#34;\u0026#34; is 0. The length of \u0026#34;H\u0026#34; is 1. The length \u0026#34;Hello\u0026#34; is 5. The length \u0026#34;Amazing\u0026#34; is 7. Another way to do this: Oh wait, I still got free time. So now I\u0026rsquo;m just going to show you another way to do this. I\u0026rsquo;m going to use for loops and lists this time.\nFirst I\u0026rsquo;m going to make a list called items and then put the \u0026quot;\u0026quot;, \u0026ldquo;H\u0026rdquo; and stuff like that:\nitems = [\u0026#34;\u0026#34;, \u0026#34;H\u0026#34;, \u0026#34;Hello\u0026#34;, \u0026#34;Amazing\u0026#34;] Then I\u0026rsquo;m going to use for loops and do the direct way.\nfor i in items: And then for the indented, I\u0026rsquo;m going to do the f string part.\nAlso I do the \u0026quot;\u0026quot; out of the {} because that\u0026rsquo;s what we want to print between.\nSo this would be how I print it out:\nprint(f\u0026#39;The length of \u0026#34;{i}\u0026#34; is {len(i)}.\u0026#39;) So this would be the whole input:\nitems = [\u0026#34;\u0026#34;, \u0026#34;H\u0026#34;, \u0026#34;Hello\u0026#34;, \u0026#34;Amazing\u0026#34;] for i in items: print(f\u0026#39;The length of \u0026#34;{i}\u0026#34; is {len(i)}.\u0026#39;) Which will also give the output:\nThe length of \u0026#34;\u0026#34; is 0. The length of \u0026#34;H\u0026#34; is 1. The length \u0026#34;Hello\u0026#34; is 5. The length \u0026#34;Amazing\u0026#34; is 7. Thanks for reading.\n","permalink":"https://sourfox.khmersite.net/p/2023/10/assignment-1-using-length/","summary":"\u003cp\u003eToday, I was given an assignment. My assignment wanted me to write a Python program that pints the length of a string.\u003c/p\u003e\n\u003cp\u003eThis is what I had to print out:\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003eThe length of \u0026#34;\u0026#34; is 0.\nThe length of \u0026#34;H\u0026#34; is 1.\nThe length of \u0026#34;Hello\u0026#34; is 5.\nThe length of \u0026#34;Amazing\u0026#34; is 7.\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003eTo do this, I have a plan in my mind which is:\u003c/p\u003e\n\u003cp\u003eStep 1. Find out what I\u0026rsquo;m going to use.\u003c/p\u003e","title":"Assignment 1: Using Length and String"},{"content":"I had an assignment that I was given for Python. What I have to do is to write a program in Python that asks a user to enter their favourite fruit, store each fruit in a list. At the end of the program, print out the total number of fruits, and also print all the fruits.\nThis is what I\u0026rsquo;m expected:\nWhat is your favourite fruit? Banana (the fruit user put) What is your favourite fruit? Apple (the fruit user put) What is your favourite fruit? Orange (the fruit user put) What is your favourite fruit? (empty) (the user didn\u0026#39;t write anything) You have 3 fruits in the basket: Banana, Apple, and Orange. So how do I do this?\nBefore I start, I need to make a plan. And here is my plan:\nMake an empty list so that I can use append() or insert() although today, I\u0026rsquo;ll be using append() since it\u0026rsquo;s easier.\nAfter that, were going to need to take an input from user so I\u0026rsquo;ll be using the input() function.\nFor the second last final step, I\u0026rsquo;m going to use while loop.\nFor the final step, I\u0026rsquo;m going to print out the last part You have 3 fruits in the basket: Banana, Apple, and Orange. using the function print().\nThis is the very final step. I\u0026rsquo;m going to put things together.\nStep 1. Make an empty list: To make my empty list, I\u0026rsquo;m going to make a variable called fruit_basket. At the end of my python program, I\u0026rsquo;m going to print all the items in the list.\nWhat I typed:\n# empty list fruit_basket = [] Step 2. Using input: Before I use the function input(), I\u0026rsquo;m going to make another variable called fruit so that the input is assigned to the variable called fruit. In the function input(), I\u0026rsquo;m going to write the asked question: What is your favourite fruit? Between the question mark and the last quotes, I\u0026rsquo;m going to add a space because it\u0026rsquo;ll look neat and the words won\u0026rsquo;t really be bunched together.\nWhat I told:\nfruit = input(\u0026#34;What is your favourite fruit? \u0026#34;) Step 3. Using while loop: When using while loop, there is a condition that has to be met. When the condition is true, the code in the while-loop is executed. If it is false, the loop will terminate.\nSo I\u0026rsquo;m going to make the condition fruit != \u0026ldquo;\u0026rdquo; which means when fruit equals nothing (\u0026quot;\u0026quot;), the loop terminates because the condition says fruit does not equal nothing, so if fruit equals nothing, then the loop stops. However, if fruit didn\u0026rsquo;t equal nothing, then the loop continue.\nSo this is how it looks like:\nReminder: The while loop always end with a colon.\nwhile fruit != \u0026#34;\u0026#34;: Now I\u0026rsquo;ve finally started the while loop so I haven\u0026rsquo;t finished yet.\nNow I\u0026rsquo;m going to use the append() so that when user answer the question, the fruit will go into the variable fruit_basket.\nSo I\u0026rsquo;ll type:\nfruit_basket.append(fruit) Great, I\u0026rsquo;ve finished that part.\nSo for the last part (which isn\u0026rsquo;t really the last part), I know that after the append, it\u0026rsquo;ll stop because it can\u0026rsquo;t continue the loop so I\u0026rsquo;ll write the same thing I did with fruit.\nfruit = input(\u0026#34;What is your favourite fruit? \u0026#34;) 4th Step. Now I\u0026rsquo;ve got the last part which is:\nYou have 3 fruits in the basket: Banana, Apple, and Orange. This last part is for when the loop stops. When it stop, It will print above the last part I showed you. I\u0026rsquo;m going to use the f string to put things together. The f string is very useful since it\u0026rsquo;s pretty easy.\nI\u0026rsquo;ll start with the function print. The I\u0026rsquo;ll add the f string. Like this:\nprint(f\u0026#34;(something)\u0026#34;) So let\u0026rsquo;s start with the bit You have () fruits in the basket: To do this, I need to find the length of the fruits. Like how much they put. So I\u0026rsquo;ll use the function len() to find the length or the total. So I\u0026rsquo;ll do len(fruit_basket) but inside the {} because that\u0026rsquo;s what join do. I\u0026rsquo;ll also use the parameter end=\u0026rsquo;\u0026rsquo; to specify the ending of the print because by default, it\u0026rsquo;ll print a new line. So I\u0026rsquo;ll write end=\u0026rsquo;\u0026rsquo;. Therefore, the whole thing will print:\nprint(f\u0026#34;You have {len(fruit_basket)} fruits in the basket: \u0026#34;,end=\u0026#34;\u0026#34;) Now I got the first bit done. Now to the very last bit.\nFor the last bit, I need to print out the fruits user answered. I\u0026rsquo;ll start with the function print() like the other bit and I\u0026rsquo;ll also use the same f string. After the f string, I\u0026rsquo;ll do the {}.\nThen I\u0026rsquo;ll type:\n{ \u0026#39;,\u0026#39;.join(fruit_basket:[-1]) } So that each item is seperated by a comma except for the last item. The [:-1] means everything is printed except for the last item. I did this because I need to add and and I also need to add a full stop at the end of the of the line. to do this, after writing the thing I typed, I\u0026rsquo;,, add a comma and than do the {}. And inside it, I\u0026rsquo;ll write:\n, and {fruit_basket[-1]}.\u0026#34;) What I typed above was that instead of just a comma between the second last and last items, I\u0026rsquo;ll put and too to seperate it because it looks nicer like that. After the last {}, I\u0026rsquo;ll finish the line by adding the full stop. And to finish the print function, I\u0026rsquo;ll add the last parenthesis.\nSo this would be how I typed it:\nprint(f\u0026#34;{ \u0026#39;, \u0026#39;.join(fruit_basket[:-1]) }, and {fruit_basket[-1]}.\u0026#34;) Step 5. Finishing up: Now that I\u0026rsquo;ve got all the pieces, I\u0026rsquo;m going to put this together.\nSo then this would be how I typed it:\nfruit_basket = [] fruit = input(\u0026#34;What is your favourite fruit? \u0026#34;) while fruit != \u0026#34;\u0026#34;: fruit_basket.append(fruit) fruit = input(\u0026#34;What is your favorite fruit? \u0026#34;) print(f\u0026#34;You have {len(fruit_basket)} fruits in the basket: \u0026#34;, end=\u0026#34;\u0026#34;) print(f\u0026#34;{ \u0026#39;, \u0026#39;.join(fruit_basket[:-1]) }, and {fruit_basket[-1]}.\u0026#34;) And what it output:\nWhat is your favourite fruit? Banana (the fruit user put) What is your favourite fruit? Apple (the fruit user put) What is your favourite fruit? Orange (the fruit user put) What is your favourite fruit? (empty) (the user didn\u0026#39;t write anything) You have 3 fruits in the basket: Banana, Apple, and Orange. Now that I have finished my assignment. I guess that\u0026rsquo;s all for today.\nThanks for reading!\n","permalink":"https://sourfox.khmersite.net/p/2023/10/assignment-2-python-using-lists-while-loop/","summary":"\u003cp\u003eI had an assignment that I was given for Python. What I have to do is to write a program in Python that asks a user to enter their favourite fruit, store each fruit in a list. At the end of the program, print out the total number of fruits, and also print all the fruits.\u003c/p\u003e\n\u003cp\u003eThis is what I\u0026rsquo;m expected:\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003eWhat is your favourite fruit? Banana (the fruit user put)\nWhat is your favourite fruit? Apple  (the fruit user put)\nWhat is your favourite fruit? Orange  (the fruit user put)\nWhat is your favourite fruit? (empty) (the user didn\u0026#39;t write anything)\n\nYou have 3 fruits in the basket: Banana, Apple, and Orange.\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003eSo how do I do this?\u003c/p\u003e","title":"Assignment 2: Python Using Lists and While-Loop"},{"content":"Today, I was asked to write a small python code to print out all items in a list with comma seperated. The last item would end the with a \u0026lsquo;dot\u0026rsquo;, or full stop.\nFor example, here is a list of sports:\nsports = [ \u0026#39;basketball\u0026#39;, \u0026#39;soccer\u0026#39;, \u0026#39;netball\u0026#39; ] And I was asked to print out the expected output:\nMy favourite sports are: basketball, soccer, netball. But how do I do this? Today, I\u0026rsquo;ll be showing you how to show the expected output using join and without join.\nDisplay items in the list with join The first one I\u0026rsquo;ll be showing you is where I will use a function called join.\nBefore we start, just a little knowledge of what join is. Join is a function that takes all the elements of a list or tuple and jons them into a single string. It will return the joined string. To use join, you have to specify a string separator that will be used to seperate the concatenated string.\nSo, now to start, I\u0026rsquo;ll be using the function print. Then I\u0026rsquo;ll write what I want the first part of what I want to write which is My favourite sports are: between the \u0026quot;\u0026quot;. Then after I\u0026rsquo;ll add the seperator whcih is a comma and the function join to join them with the variable sports. And at the end, I\u0026rsquo;ll add another function called end= to end the senctence with a full stop and a new line so that we could write another command.\nHere is what I wrote:\nprint(\u0026#34;My favourite sports are:\u0026#34;, \u0026#34;, \u0026#34;.join(sports), end=\u0026#39;.\\n\u0026#39;) And this is the output:\nMy favourite sports are: basketball, soccer, netball. So this has been achieved but this is only the first part.\nDisplay items in the list without join Now here\u0026rsquo;s the second way to write the expected output. This way does not include the function join.\nReminder: It may not work on the python because the python is interactive so you should use a code writer for this\nFirst, let\u0026rsquo;s show the simple bit which is My favourite sport is::\nprint(\u0026#34;My favourite sport is:\u0026#34;) Now let\u0026rsquo;s do the hard bit. We want to print dino, robo, plush.. Let\u0026rsquo;s use the for loop (a function to loop) to do this. We also use the print function after to put a full stop at the end. However there would also be a comma too.\nfor i in sports: print(i, end=\u0026#39;, \u0026#39;) \u0026gt;\u0026gt;\u0026gt; print(\u0026#39;.\u0026#39;) Now we\u0026rsquo;ve gotten that part. But could I do the expected output when I have one bit and another? So then this would be how we print the whole thing:\nprint(\u0026#34;My favorite sports are:\u0026#34;, end=\u0026#34; \u0026#34;) # print everything except the last item in the list for i in range(len(sports)-1): print(sports[i], end=\u0026#39;, \u0026#39;) # print the last item, remove the space (\u0026#39; \u0026#39;) seperation, and add a \u0026#39;.\u0026#39;. print(sports[-1], \u0026#39;.\u0026#39;, sep=\u0026#39;\u0026#39;) And what above I wrote will give the same expected output:\nMy favourite sports are: basketball, soccer, netball. Thanks for reading!\n","permalink":"https://sourfox.khmersite.net/p/2023/10/display-items-in-python-list/","summary":"\u003cp\u003eToday, I was asked to write a small python code to print out all items in a list with comma seperated. The last item would end the with a \u0026lsquo;dot\u0026rsquo;, or full stop.\u003c/p\u003e\n\u003cp\u003eFor example, here is a list of sports:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-python\" data-lang=\"python\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"n\"\u003esports\u003c/span\u003e \u003cspan class=\"o\"\u003e=\u003c/span\u003e \u003cspan class=\"p\"\u003e[\u003c/span\u003e \u003cspan class=\"s1\"\u003e\u0026#39;basketball\u0026#39;\u003c/span\u003e\u003cspan class=\"p\"\u003e,\u003c/span\u003e \u003cspan class=\"s1\"\u003e\u0026#39;soccer\u0026#39;\u003c/span\u003e\u003cspan class=\"p\"\u003e,\u003c/span\u003e \u003cspan class=\"s1\"\u003e\u0026#39;netball\u0026#39;\u003c/span\u003e \u003cspan class=\"p\"\u003e]\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eAnd I was asked to print out the expected output:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre tabindex=\"0\" class=\"chroma\"\u003e\u003ccode class=\"language-python\" data-lang=\"python\"\u003e\u003cspan class=\"line\"\u003e\u003cspan class=\"cl\"\u003e\u003cspan class=\"n\"\u003eMy\u003c/span\u003e \u003cspan class=\"n\"\u003efavourite\u003c/span\u003e \u003cspan class=\"n\"\u003esports\u003c/span\u003e \u003cspan class=\"n\"\u003eare\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e \u003cspan class=\"n\"\u003ebasketball\u003c/span\u003e\u003cspan class=\"p\"\u003e,\u003c/span\u003e \u003cspan class=\"n\"\u003esoccer\u003c/span\u003e\u003cspan class=\"p\"\u003e,\u003c/span\u003e \u003cspan class=\"n\"\u003enetball\u003c/span\u003e\u003cspan class=\"o\"\u003e.\u003c/span\u003e\n\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eBut how do I do this? Today, I\u0026rsquo;ll be showing you how to show the expected output using \u003cstrong\u003ejoin\u003c/strong\u003e and without join.\u003c/p\u003e","title":"Display Items in Python List"},{"content":"Hello World! Today, Sour Fox site has been born!\n","permalink":"https://sourfox.khmersite.net/p/2023/9/hello-world/","summary":"\u003cp\u003eHello World! Today, Sour Fox site has been born!\u003c/p\u003e","title":"Hello World"}]