<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Processing Data
Working With Numbers
Let's get some integer (aka whole number) variables going and learn how to add, divide, subtract and multiply in Python.
Addition
Run the following code to see how Python adds together numbers
Step1:  Subtraction
Run the following code to see how Python subtracts numbers
Step2:  Multiplication
Python uses an asterisk * to show multiplication.
Run the following code to see how Python multiplies numbers
Step3:  Division
Python uses a forward slash / to show division.
Run the following code to see how Python divides numbers
Step4:  Extra Useful Bit
Step5:  Working with Strings - aka Text
Text characters are called strings in Python - this is because they are stored as a string of characters.
Here are two example strings to look at
Step6:  Change line 3 of the above program to put in a space
Hint
Step7:  Getting Rid of all the ' ' Space Bits
It's pretty horrible having to do noun1+' '+verb1, putting in all those ' ' spaces.
Here's the same program again, but this time using print() with commas to do the work.
The disadvantage of this is the sentence isn't being stored in a variable.
In the last line below, use commas to make your own sentence
Step8:  How Long is a Piece of String
As well as all that science, Python can easily tell us how long strings really are! Who knew?
python
print(len("How long is this string?"))
Exercise
Print the lengths of each of the strings in these variables using the len() function
<ASSISTANT_TASK:>
Python Code:
boys = int(input('How many boys are in the class: '))
girls = int(input('How many girls are in the class:'))
pupils = boys + girls
print('There are', pupils,'in the class altogether')
Explanation: Processing Data
Working With Numbers
Let's get some integer (aka whole number) variables going and learn how to add, divide, subtract and multiply in Python.
Addition
Run the following code to see how Python adds together numbers
End of explanation
bigger_number = 12
smaller_number = 10
difference = bigger_number - smaller_number
print('The difference between', bigger_number, 'and', smaller_number, 'is', difference)
Explanation: Subtraction
Run the following code to see how Python subtracts numbers
End of explanation
number1 = 5
number2 = 6
answer = number1 * number2
print(answer)
Explanation: Multiplication
Python uses an asterisk * to show multiplication.
Run the following code to see how Python multiplies numbers
End of explanation
big_number = 100
divisor_number = 25
dividend_answer = 100/25
print(big_number,'divided by', divisor_number, 'is', dividend_answer)
Explanation: Division
Python uses a forward slash / to show division.
Run the following code to see how Python divides numbers
End of explanation
big_number = 102
divisor_number = 25
remainder = 100%25
print('If you divide', big_number,'by', divisor_number, 'you get', remainder, 'left over')
Explanation: Extra Useful Bit: Modulo Division (Remainder/Left Overs)
Python uses a percentage sign % to calculate remainders
Run the following code to see how Python can compute remainders when dividing
End of explanation
phrase1 = 'The quick brown fox jumped over'
phrase2 = 'the moon'
sentence = phrase1+phrase2
print(sentence)
Explanation: Working with Strings - aka Text
Text characters are called strings in Python - this is because they are stored as a string of characters.
Here are two example strings to look at:
python
phrase1 = 'The quick brown fox jumped over'
phrase2 = 'the moon'
I've assigned them to two variables called phrase1 and phrase2.
Run the following code to see how we can add strings.
End of explanation
noun1 = 'turnip'
noun2 = 'elephant'
noun3 = 'worm'
noun4 = 'holiday'
noun5 = 'Scalloway'
verb1 = 'went'
verb2 = 'ate'
verb3 = 'sat'
verb4 = 'jumped'
preposition1 = 'on'
preposition2 = 'to'
preposition3 = 'with'
def_article = 'the'
indef_article = 'a'
example1 = def_article+' '+noun1+' '+verb1+' '+preposition1+' '+noun4+' '+preposition2+' '+noun5
example2 = 'change this line'
print(example1)
print(example2)
Explanation: Change line 3 of the above program to put in a space
Hint: +' '+
If you've done it right, your output should look like:  
The quick brown fox jumped over the moon
Exercise
Choose some of the word variables below, add them to make an example sentence of your own
End of explanation
noun1 = 'turnip'
noun2 = 'elephant'
noun3 = 'worm'
noun4 = 'holiday'
noun5 = 'Scalloway'
verb1 = 'went'
verb2 = 'ate'
verb3 = 'sat'
verb4 = 'jumped'
preposition1 = 'on'
preposition2 = 'to'
preposition3 = 'with'
def_article = 'the'
indef_article = 'a'
print(def_article,noun1,verb1,preposition1,noun4,preposition2,noun5)
print('replace this with your own choice of variables')
Explanation: Getting Rid of all the ' ' Space Bits
It's pretty horrible having to do noun1+' '+verb1, putting in all those ' ' spaces.
Here's the same program again, but this time using print() with commas to do the work.
The disadvantage of this is the sentence isn't being stored in a variable.
In the last line below, use commas to make your own sentence
End of explanation
noun1 = 'turnip'
noun2 = 'elephant'
noun3 = 'worm'
noun4 = 'holiday'
Explanation: How Long is a Piece of String
As well as all that science, Python can easily tell us how long strings really are! Who knew?
python
print(len("How long is this string?"))
Exercise
Print the lengths of each of the strings in these variables using the len() function
End of explanation
<END_TASK>