<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>String on SourFox</title>
    <link>https://sourfox.khmersite.net/tags/string/</link>
    <description>Recent content in String on SourFox</description>
    <image>
      <title>SourFox</title>
      <url>https://sourfox.khmersite.net/papermod-cover.png</url>
      <link>https://sourfox.khmersite.net/papermod-cover.png</link>
    </image>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Fri, 09 Aug 2024 19:17:12 +1000</lastBuildDate>
    <atom:link href="https://sourfox.khmersite.net/tags/string/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Atm Bill Dispenser</title>
      <link>https://sourfox.khmersite.net/p/2024/8/atm/</link>
      <pubDate>Fri, 09 Aug 2024 19:17:12 +1000</pubDate>
      <guid>https://sourfox.khmersite.net/p/2024/8/atm/</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;In the code are short explanations of why I used it.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# asks the customer to enter an amount of number.
atm = int(input(&amp;#34;Enter an amount in a multiple of 5: &amp;#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&amp;#34;You entered ${atm}: {dispenser(atm)}&amp;#34;)
&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Commas replaced by dots</title>
      <link>https://sourfox.khmersite.net/p/2023/12/switching-commas/</link>
      <pubDate>Tue, 26 Dec 2023 14:55:12 +1100</pubDate>
      <guid>https://sourfox.khmersite.net/p/2023/12/switching-commas/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s been a long time since i&amp;rsquo;ve done a blog post. I wonder why&amp;hellip;.&lt;/p&gt;
&lt;p&gt;Welp, today I&amp;rsquo;ve got an assignment, today&amp;rsquo;s one is to write a python program that prints a version of the strings with all commas replaced by dots. Like this.&lt;/p&gt;
&lt;p&gt;Example -&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;  Input               Output
&amp;#34;Hello, World!&amp;#34;      &amp;#34;Hello. World!&amp;#34;
&amp;#34;725,000&amp;#34;            &amp;#34;725.000&amp;#34;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;First, I&amp;rsquo;m going to do the 1st one. I&amp;rsquo;m going to assign it to a variable called string.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Assignment 3: Doubling </title>
      <link>https://sourfox.khmersite.net/p/2023/10/assignment-3/</link>
      <pubDate>Wed, 18 Oct 2023 18:59:17 +1100</pubDate>
      <guid>https://sourfox.khmersite.net/p/2023/10/assignment-3/</guid>
      <description>&lt;p&gt;Today, I was given another assignment. (Which I wasn&amp;rsquo;t expecting.) Today&amp;rsquo;s assignment was to write a python program which had to meet the conditions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Write a Python proram that multiplies all the items in a list by the value of the variable factor.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The program must print the list as the output.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The program should allow multiplying the variable factor by a string in case the list contains strings.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You may assume that the value of factor will be a positive integer.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Assignment 1: Using Length and String</title>
      <link>https://sourfox.khmersite.net/p/2023/10/assignment-1-using-length/</link>
      <pubDate>Sun, 15 Oct 2023 11:14:44 +1100</pubDate>
      <guid>https://sourfox.khmersite.net/p/2023/10/assignment-1-using-length/</guid>
      <description>&lt;p&gt;Today, I was given an assignment. My assignment wanted me to write a Python program that pints the length of a string.&lt;/p&gt;
&lt;p&gt;This is what I had to print out:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;The length of &amp;#34;&amp;#34; is 0.
The length of &amp;#34;H&amp;#34; is 1.
The length of &amp;#34;Hello&amp;#34; is 5.
The length of &amp;#34;Amazing&amp;#34; is 7.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To do this, I have a plan in my mind which is:&lt;/p&gt;
&lt;p&gt;Step 1. Find out what I&amp;rsquo;m going to use.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
