<jupyter_start><jupyter_text>Data types and Variables---**Recap**: Variables can store data of different types.  *   **int** (whole numbers, e.g. 4, 523, 1984)  *   **float** (decimal numbers e.g. 4.3, )  *   **str** (strings of characters)  *   **bool** (True or False)  and can be stored in groups (**lists, tuples, dictionaries,** etc)Once a variable has been assigned a value it will decide what type it is from that value. For example:  firstname = “Monty”  age = 20  *firstname* is now a *str* variable (a string of characters) *age* is now an *int* variable (a whole number)  Once a variable knows its type you will only be able to use it for processes that are relevant to that type. For example, you won't be able to add firstname and age together because firstname is a word and age is a number. You would, however, be able to add 1 to the age  age = age + 1  age is now 1 bigger than it was before  Using variables of different types and functions---- Exercise 1The cell below contains a function. Functions are named sets of instructions that do one particular thing, often creating a new set of data but sometimes just setting something up.  A function starts with the keyword def (short for define or definition). All instructions below the definition are indented and this indicates that they are part of that function. A function runs when its name is used outside the function (here it is not indented). The indentation is important, note where the code is and isn't indented.  *  create a variable called **name** and assign it a value (any name)  *  print the message “Hello” name  *  change the value of `name` and run the code again to get a new message<jupyter_code>In [8]:
def print_welcome():
   # create the variable called name below here (indented like this line) and add the instruction print("Hello",name)
  
  
  
print_welcome()<jupyter_output><empty_output><jupyter_text>---- Exercise 2*  create two variables **num1** and **num2** and assign them each a whole number  *  create a third variable **total** which will store the sum of num1 + num2  *  run the code.  Change the value of one of the numbers and run the code again to get new messages and a new total.<jupyter_code>def print_total():
  # add your code below here
  
  
  print(num1, "+", num2, "=", total)

print_total()<jupyter_output><empty_output><jupyter_text>--- Exercise 3 - variables of different types*  create a variable called **name** and assign it the value "Monty"  *  create a variable called **age** and assign it the value 101  *  print a message "Hello `name` you are `age` years old" Test input:  Billy  18  Expected output:  Hello Billy you are 18 years old<jupyter_code>def print_info():
   # add your code below here
  
  

print_info()<jupyter_output><empty_output><jupyter_text>--- Exercise 4 - float variables (and writing your own function)Write a function called **print_price()** which will:  *  create a variable called **product** and assign the value "Chocolate Bar"  *  create a variable called **cost** and assign the value 1.39  *  print the message `product`, "costs", "£", `cost`  Expected output:  Chocolate Bar costs £ 1.39<jupyter_code><jupyter_output><empty_output><jupyter_text>--- Exercise 5 - concatenating stringsWrite a function called **print_full_name()** which will:  *  create variable called **name** and assign it the value "Monty"  *  create a variable called **surname** and assign it the value "Python"  *  create a variable called **full_name** and assign it the value `name` + " " + `surname`  *  print the `full_name`  Expected output:  Monty Python<jupyter_code><jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08893768871808949, 'fraction_numerical': 0.010979961570134504, 'mean_word_length': 4.296511627906977, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '150688', 'license': 'CC0-1.0', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1014, 'n_words': 517, 'path': 'DataTypes1.ipynb', 'repo_name': 'lilaceri/python-fundamentals', 'size': '3643'}