<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Class Coding Lab
Step1:  Types Matter
Python's built in functions and operators work differently depending on the type of the variable.
Step2:  Switching Types
there are built-in Python functions for switching types. For example
Step3:  Inputs type str
When you use the input() function the result is of type str
Step4:  We can use a built in Python function to convert the type from str to our desired type
Step5:  We typically combine the first two lines into one expression like this
Step6:  1.1 You Code
Step7:  Format Codes
Python has some string format codes which allow us to control the output of our variables. 
%s = format variable as str
%d = format variable as int
%f = format variable as float
You can also include the number of spaces to use for example %5.2f prints a float with 5 spaces 2 to the right of the decimal point.
Step8:  Formatting with F-Strings
The other method of formatting data in Python is F-strings. As we saw in the last lab, F-strings use interpolation to specify the variables we would like to print in-line with the print string.
You can format an f-string
{var
Step9:  1.2 You Code
Re-write the program from (1.1 You Code) so that the print statement uses format codes. Remember
Step10:  1.3 You Code
Use F-strings or format codes to Print the PI variable out 3 times. 
Once as a string, 
Once as an int, and 
Once as a float to 4 decimal places.
Step11:  Putting it all together
Step12:  Metacognition
Rate your comfort level with this week's material so far.
1 ==> I don't understand this at all yet and need extra help. If you choose this please try to articulate that which you do not understand to the best of your ability in the questions and comments section below.
2 ==> I can do this with help or guidance from other people or resources. If you choose this level, please indicate HOW this person helped you in the questions and comments section below. 
3 ==> I can do this on my own without any help. 
4 ==> I can do this on my own and can explain/teach how to do it to others.
--== Double-Click Here then Enter a Number 1 through 4 Below This Line ==--  
Questions And Comments
Record any questions or comments you have about this lab that you would like to discuss in your recitation. It is expected you will have questions if you did not complete the code sections correctly.  Learning how to articulate what you do not understand is an important skill of critical thinking. Write them down here so that you remember to ask them in your recitation. We expect you will take responsilbity for your learning and ask questions in class.
--== Double-click Here then Enter Your Questions Below this Line ==--
<ASSISTANT_TASK:>
Python Code:
a = "4"
type(a) # should be str
a = 4
type(a) # should be int
Explanation: Class Coding Lab: Variables And Types
The goals of this lab are to help you to understand:
Python data types
Getting input as different types
Formatting output as different types
Basic arithmetic operators
How to create a program from an idea.
Variable Types
Every Python variable has a type. The Type determines how the data is stored in the computer's memory:
End of explanation
a = 4
b = 5
a + b # this plus in this case means add so 9
a = "4"
b = "5"
a + b # the plus + in this case means concatenation, so '45'
Explanation: Types Matter
Python's built in functions and operators work differently depending on the type of the variable.:
End of explanation
x = "45" # x is a str
y = int(x)  # y is now an int
z = float(x) # z is a float
print(x,y,z)
Explanation: Switching Types
there are built-in Python functions for switching types. For example:
End of explanation
age = input("Enter your age: ")
type(age)
Explanation: Inputs type str
When you use the input() function the result is of type str:
End of explanation
age = input("Enter your age: ")
age = int(age)
type(age)
Explanation: We can use a built in Python function to convert the type from str to our desired type:
End of explanation
age = int(input("Enter your age: "))
type(age)
Explanation: We typically combine the first two lines into one expression like this:
End of explanation
# TODO: Debug this code
age = input("Enter your age: ")
nextage = age + 1
print("Today you are age next year you will be {nextage}")
Explanation: 1.1 You Code: Debuging
The following program has errors in it. Your task is to fix the errors so that:
your age can be input and convertred to an integer.
the program outputs your age and your age next year. 
For example:
Enter your age: 45
Today you are 45 next year you will be 46
End of explanation
name = "Mike"
age = 45
gpa = 3.4
print("%s is %d years old. His gpa is %.3f" % (name, age,gpa))
Explanation: Format Codes
Python has some string format codes which allow us to control the output of our variables. 
%s = format variable as str
%d = format variable as int
%f = format variable as float
You can also include the number of spaces to use for example %5.2f prints a float with 5 spaces 2 to the right of the decimal point.
End of explanation
name ="Mike"
wage = 15
print(f"{name} makes ${wage:.2f} per hour")
Explanation: Formatting with F-Strings
The other method of formatting data in Python is F-strings. As we saw in the last lab, F-strings use interpolation to specify the variables we would like to print in-line with the print string.
You can format an f-string
{var:d} formats var as integer
{var:f} formats var as float
{var:.3f} formats var as float to 3 decimal places.
Example:
End of explanation
# TODO: Write code here
Explanation: 1.2 You Code
Re-write the program from (1.1 You Code) so that the print statement uses format codes. Remember: do not copy code, as practice, re-write it.
End of explanation
#TODO: Write Code Here
Explanation: 1.3 You Code
Use F-strings or format codes to Print the PI variable out 3 times. 
Once as a string, 
Once as an int, and 
Once as a float to 4 decimal places.
End of explanation
# TODO: Write your code here
Explanation: Putting it all together: Fred's Fence Estimator
Fred's Fence has hired you to write a program to  estimate the cost of their fencing projects. For a given length and width you will calculate the number of 6 foot fence sections, and the total cost of the project. Each fence section costs $23.95. Assume the posts and labor are free.
Program Inputs:
Length of yard in feet
Width of yard in feet
Program Outputs:
Perimeter of yard ( 2 x (Length + Width))
Number of fence sections required (Permiemer divided by 6 )
Total cost for fence ( fence sections multiplied by $23.95 )
NOTE: All outputs should be formatted to 2 decimal places: e.g. 123.05 
```
TODO:
1. Input length of yard as float, assign to a variable
2. Input Width of yard as float, assign to a variable
3. Calculate perimeter of yard, assign to a variable
4. calculate number of fence sections, assign to a variable
5. calculate total cost, assign to variable
6. print perimeter of yard
7. print number of fence sections
8. print total cost for fence.
```
1.4 You Code
Based on the provided TODO, write the program in python in the cell below. Your solution should have 8 lines of code, one for each TODO.
HINT: Don't try to write the program in one sitting. Instead write a line of code, run it, verify it works and fix any issues with it before writing the next line of code.
End of explanation
# run this code to turn in your work!
from coursetools.submission import Submission
Submission().submit()
Explanation: Metacognition
Rate your comfort level with this week's material so far.
1 ==> I don't understand this at all yet and need extra help. If you choose this please try to articulate that which you do not understand to the best of your ability in the questions and comments section below.
2 ==> I can do this with help or guidance from other people or resources. If you choose this level, please indicate HOW this person helped you in the questions and comments section below. 
3 ==> I can do this on my own without any help. 
4 ==> I can do this on my own and can explain/teach how to do it to others.
--== Double-Click Here then Enter a Number 1 through 4 Below This Line ==--  
Questions And Comments
Record any questions or comments you have about this lab that you would like to discuss in your recitation. It is expected you will have questions if you did not complete the code sections correctly.  Learning how to articulate what you do not understand is an important skill of critical thinking. Write them down here so that you remember to ask them in your recitation. We expect you will take responsilbity for your learning and ask questions in class.
--== Double-click Here then Enter Your Questions Below this Line ==--
End of explanation
<END_TASK>