<jupyter_start><jupyter_text>Exercise 1How can you improve the syntax used in the following code cells?Think about conventions, and code readability.<jupyter_code>x=  4+ 1
print(x); x = x + 1; print(x); x += 1; print(x)
for i in range(10):
  if i % 3 == 0  :#checks to see if i is a multiple of 3
         print(i, 'is a multiple of 3!')
2*8+8/4-9+2*1-1<jupyter_output><empty_output><jupyter_text>Exercise 2Create a variable `savings` and give it value 200<jupyter_code># Your answer goes here<jupyter_output><empty_output><jupyter_text>Create a variable `factor` and assign it value 1.1<jupyter_code># Your answer goes here<jupyter_output><empty_output><jupyter_text>Calculate `balance`:<jupyter_code>balance = savings * factor ** 5<jupyter_output><empty_output><jupyter_text>Now print a statement that says something like "Your account balance after 5 years would be: $xxx" and use the value of `balance` to populate xxx:<jupyter_code># Your answer goes here<jupyter_output>Your account balance after 5 years would be: $ 322.1020000000001<jupyter_text>Let's make two modifications to this:* use `sep = ''` in print function to avoid the extra space between dollar sign and balance value.* use `round()` function to round to two decimalsNote: Use `?round` in a new cell to get help from the help function.<jupyter_code># Your answer goes here<jupyter_output>Your account balance after 5 years would be: $322.1<jupyter_text>Exercise 3The value of pi is given below in a string/character format:<jupyter_code>pi_char = "3.1415926535"
type(pi_char)<jupyter_output><empty_output><jupyter_text>Google and find a function that would convert it to float so we can use it in math equations, call this new converted value `pi`<jupyter_code># Your answer goes here<jupyter_output><empty_output><jupyter_text>Using this variable calculate the area of a circle with radius `r = 2` and print a rounded value for area (up to 3 decimals):<jupyter_code># Your answer goes here<jupyter_output>The area of a circle with radius 2 is 12.566<jupyter_text>Exercise 4What is the quotient and remainder of 67432/98?<jupyter_code># Your answer goes here<jupyter_output>Quotient of 67432/98: 688
Remainder of 67432/98: 8<jupyter_text>Exercise 5Write a statement to check whether `a` is a multiple of 5 and within the range of 100-150 or 0-50. Check your statement with the following values and it should give you the following values:55 --> False110 --> True-25 --> False150 --> False100 --> True<jupyter_code># Your answer goes here<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08668242710795902, 'fraction_numerical': 0.04688731284475965, 'mean_word_length': 5.806970509383378, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 46, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '150482', 'license': 'MIT', 'n_tokens_mistral': 905, 'n_tokens_neox': 810, 'n_words': 313, 'path': '01-Introduction/Exercise-02-Python-Syntax-and-Semantics.ipynb', 'repo_name': 'nikkiii66/Intro-to-Data-Analytics', 'size': '2538'}