Using variables

111 1 0
                                    

    Variables are one way we can make print() fancy. Changing the value of a variable can make lots of moving parts on a program work.
There are too data types for variables and sometimes if you don't tell python what type the variable is it will get confused. This is because strings and integers are used for different things. A string is for storing text and has no numerical value even if storing numbers.
    A integer is for storing numbers and tells python that the value has a numerical values. I'll explain more later during conditionals why this is important. One thing you will need to know is how to store variables.
    To do that you need to name the variable, it can't have spaces. It_can_be_this. In order to give a variable a value
    Variable_here = string or integer here. See in the code below
#code start
Example = Hello, Wattpad
Print(str(Example))
Example = Goodbye, Wattpad
Print(str(Example))
#code end
    You may notice there aren't any " " in print this time. This is because "this is how you print text only" if you were to print("Example") you would just get Example because it's a string. Remember if you want to print a variable do not use " " it will not work. You will also notice how I used the same exact print lines and printed two different things. It's because I changed the variable. *Don't forget to define you varibles*

Learn python scripting for beginnersWhere stories live. Discover now