Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Untitled
a guest
Oct 19th, 2018
84
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
Python
0.20 KB
| None
|
0
0
raw
download
clone
embed
print
report
import
math
def
trapez_rule
(
f
,
a
,
b
,
n
)
:
h
=
(
b-a
)
/n
s
=
f
(
a
)
+f
(
b
)
for
i
in
xrange
(
1
,
n
)
:
s +
=
2.0
*f
(
a+i*h
)
return
s*h/
2
print
trapez_rule
(
lambda
x:
math
.
e
**
(
-x**
2
)
,
-
1.0
,
1.0
,
100
)
Add Comment
Please,
Sign In
to add comment
Public Pastes
Untitled
PowerShell | 37 min ago | 0.66 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 🎁
GetText | 45 min ago | 0.38 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 🤑
GetText | 58 min ago | 0.39 KB
Untitled
JSON | 1 hour ago | 0.03 KB
Arduino - Lettura sensore differenziale MS452...
Arduino | 1 hour ago | 1.59 KB
Задача 5
Python | 2 hours ago | 0.57 KB
CC Mekanism Induction Battery Monitoring V2
Lua | 2 hours ago | 6.67 KB
Задача 4
Python | 2 hours ago | 0.68 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!