Before you start this course, you must login to Replit
If you have forgotten your Replit account user name or password, ask your Coder Coach.
If you have forgotten your Replit account user name or password, ask your Coder Coach.
Students will learn how to perform simple calculations using fixed numbers, numbers in variables, and numbers from the user
Be able to read, understand, trace, adapt and create Python code using selection that:
If one / is used for division, the result will be a decimal, known as a float. If two // are used for division, the result will be a whole number, known as an integer (or int for short).
Input from the user in Python code is usually a string(text), but calculations required an integer(whole number) or a float(decimal number). Casting is the act of changing the data type of a variable to match a need.
To save the user’s inputted number as a whole number in a variable, use **int(input(“Ask user to enter something -> “))
To save the variable as a decimal number, use **float(input(“Ask user to enter something -> “))
The link to the slide deck for this topic can be found here:
https://docs.google.com/presentation/d/1choFBbf7jyjNm-h37Z4Qyo1xOVVTj0W6mj6PCLRjbYw/edit?usp=sharing
When you run into an error with your code, ensure you have checked the following:
+ addition
- subtraction
* multiplication
/ float division
// integer division