<?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>Input on SourFox</title>
    <link>https://sourfox.khmersite.net/tags/input/</link>
    <description>Recent content in Input 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/input/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>Finding the GCD of two numbers</title>
      <link>https://sourfox.khmersite.net/p/2024/7/assignment_gcd/</link>
      <pubDate>Fri, 12 Jul 2024 12:43:30 +1000</pubDate>
      <guid>https://sourfox.khmersite.net/p/2024/7/assignment_gcd/</guid>
      <description>&lt;p&gt;In this assignment, it&amp;rsquo;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&amp;rsquo;ll explain to you what each part of the code is doing.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#The two variables &amp;#39;num&amp;#39; and &amp;#39;ber&amp;#39; will be where the inputs will be stored in. When it starts it will show &amp;#39;(num)a: &amp;#39; and you&amp;#39;ll have to put a number in. This goes the same for &amp;#39;(ber)b: &amp;#39;

num = int(input(&amp;#34;a: &amp;#34;))
ber = int(input(&amp;#34;b: &amp;#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&amp;#39;ll gather their answer and print it for you as a sentence.

print(f&amp;#34;The GCD {num}, {ber} is {gcd(num, ber)}.&amp;#34;)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;That&amp;rsquo;s all today. Bye!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Check if a year is a leap year</title>
      <link>https://sourfox.khmersite.net/p/2024/5/assignment_9/</link>
      <pubDate>Tue, 14 May 2024 17:43:09 +1000</pubDate>
      <guid>https://sourfox.khmersite.net/p/2024/5/assignment_9/</guid>
      <description>&lt;p&gt;Today, I just got back to python after a few months. So when coming back, I got an assignment. My assignment was to &lt;em&gt;check if a year is a leap year.&lt;/em&gt; In the assignment, it also gave hints. These were the hints:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;A 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
&lt;strong&gt;This is how you can determine if a year is a leap year or not:&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Assignment 2: Python Using Lists and While-Loop</title>
      <link>https://sourfox.khmersite.net/p/2023/10/assignment-2-python-using-lists-while-loop/</link>
      <pubDate>Sat, 07 Oct 2023 12:43:22 +1100</pubDate>
      <guid>https://sourfox.khmersite.net/p/2023/10/assignment-2-python-using-lists-while-loop/</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;This is what I&amp;rsquo;m expected:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;What 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&amp;#39;t write anything)

You have 3 fruits in the basket: Banana, Apple, and Orange.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So how do I do this?&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
