<jupyter_start><jupyter_text>**Malak' Exersizes**<jupyter_code>Normal_range = range(60, 120)
glucose = int(input('what is your glucose reading?:'))

if glucose in Normal_range:
  print('Normal')
elif glucose < 60:
  print('Low')
else:
  print('High')
normal_range = range(60,120)
glucose = int(input("what is your glucose reading? "))

if glucose in normal_range:
   print("Your glucose level is in the normal range")
else:
   print("Your glucose level i is not the normal range")
  
glucose = input("what is your glucose reading? ")

if int(glucose) in range(60,120):
   print(f"Your glucose level {glucose} is in the normal range 60-120")
else:
   print(f"Your glucose level {glucose} is not the normal range 60-120")<jupyter_output>what is your glucose reading? 140
Your glucose level 140 is not the normal range 60-120<jupyter_text>**Workshop's Exersizes**<jupyter_code>def seq_avg(x,y):
  return (x+y)/2
lambda x,y: (x+y)/2
def seq_avg2(seq:list)-> float:
  '''docstring: return the average of the list
  >>> seq([2,6])
  3.5
  '''
  return sum(seq)/len(seq)

x = [3,4,5,3,2]
seq_avg2(x)

seq_avg2.__doc__
#dunder doc , sphinx or doctest will make pdf out of the docstring and test the docstring examples 
help(seq_avg2)
def subgroup_apply(data, agg_func = seq_avg2):
  return agg_func(data)
x = [3,5,7,3]
print(f'the result of subgroup_apply(x) is {subgroup_apply(x)}')
print(f'the result of subgroup_apply(x, sum) is {subgroup_apply(x, sum)}')
id(x)
import sys

y = sys.getrefcount(x)
y

#from the local namespace and global namespace

x.append(6)
x
id(x)
dir()
class Cup:
  def __init__(self, amount, ingred):
    self.amount = amount
    self.ingred = ingred
  def human_readable(self):
    return f'{self.amount:.1f} cups of {self.ingred}'

sugar = Cup(0.532, 'sugar')
#dir(c)

res = sugar.human_readable()
res
class Cup:
  def __init__(self, num, dem, ingred):
    self.num = num
    self.dem = dem
    self._ingred = ingred
  def human_readable(self):
    return f'{self.num:.0f}/{self.dem:.0f} cups of {self._ingred}'
sugar = Cup(2,3, 'sugar')
res = sugar.human_readable()
res
sugar._ingred
from dataclasses import dataclass
import typing

@dataclass
class Measurement:
  def __init__(self, num, dem, ingred):
    self.num = num
    self.dem = dem
    self._ingred = ingred


class Cup(Measurement):
  def human_readable(self):
    return f'{self.num:.0f}/{self.dem:.0f} cups of {self._ingred}'

@property
class Tablespoon(Measurement) :
  def human_readable(self):
    return f'{self.num:.0f}/{self.dem:.0f} tablespoon of {seld._ingred}'


from dataclasses import dataclass
import typing
import fractions

@dataclass
class Measurement:
  def __init__(self, num, dem, ingred):
    self.amount = fractions.Fraction(num/dem)
    self._ingred = ingred

  def human_readable(self):
    return f'{self.amount} {self.mname} of {self._ingred}'

class Cup(Measurement):
  mname = 'cup'

@property
class Tablespoon(Measurement) :
  mname ='tbs'

c = Cup(3,4, 'salt')
a = c.human_readable()
a<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13355371900826446, 'fraction_numerical': 0.02446280991735537, 'mean_word_length': 4.645522388059701, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '549889', 'license': 'MIT', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1098, 'n_words': 311, 'path': 'External_exe.ipynb', 'repo_name': 'BatoolMM/fastai', 'size': '3025'}