eaglelandsonce commited on
Commit
a03a407
·
verified ·
1 Parent(s): 731330d

Update pages/3_NumpyBasics.py

Browse files
Files changed (1) hide show
  1. pages/3_NumpyBasics.py +3 -3
pages/3_NumpyBasics.py CHANGED
@@ -5,8 +5,7 @@ import numpy as np
5
  def example1():
6
  explanation = "Importing the NumPy library."
7
  code = "import numpy as np"
8
- exec(code)
9
- return explanation, code
10
 
11
  def example2():
12
  explanation = "Creating a simple NumPy array."
@@ -170,4 +169,5 @@ for title, func in examples:
170
  st.write(explanation)
171
  st.code(code)
172
  if st.button(f"Run {title.split(':')[0]}"):
173
- st.write("Output:", result)
 
 
5
  def example1():
6
  explanation = "Importing the NumPy library."
7
  code = "import numpy as np"
8
+ return explanation, code, None
 
9
 
10
  def example2():
11
  explanation = "Creating a simple NumPy array."
 
169
  st.write(explanation)
170
  st.code(code)
171
  if st.button(f"Run {title.split(':')[0]}"):
172
+ if result is not None:
173
+ st.write("Output:", result)