Kalaphant commited on
Commit
fc72187
·
verified ·
1 Parent(s): e89ffda

Update data.csv

Browse files
Files changed (1) hide show
  1. data.csv +39 -5
data.csv CHANGED
@@ -1,5 +1,39 @@
1
- prompt,response
2
- "Hello, how are you?","I'm doing fine!"
3
- "What is 1+1","1+1 is equal to 2"
4
- "When did time start","13.8 billion years ago. Time started when the Big Bang happened, at the start of the universe."
5
- "When was the Big Bang?","13.8 billion years ago. The Big Bang was the moment 13.8 billion years ago when the universe began as a tiny, dense, fireball that exploded. Most astronomers use the Big Bang theory to explain how the universe began. But what caused this explosion in the first place is still a mystery."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ input:,output:
2
+ Write a py script for a weighted average. It accepts an indefinite number of args.,"Sure! For this, we'll use `*args` to create indefinite arguments.
3
+ Then, we will multiply each item by its weight, while making sure to account for it in the mean.
4
+ Here is the code:
5
+ ```python
6
+ import math
7
+
8
+ def weightedAverage(*args):
9
+
10
+ weighted_sum = 0
11
+ total_weight = 0
12
+
13
+ nums = []
14
+ for i in range(0, len(args), 2):
15
+ number = args[i]
16
+ weight = args[i+1]
17
+ weighted_sum += number * weight
18
+ total_weight += weight
19
+
20
+ return weighted_sum / total_weight
21
+
22
+ print(weightedAverage(2, 3, 1, 2, 5, 2))
23
+ ```
24
+ Usage:
25
+ arg1: first number
26
+ arg2: weight of the first number
27
+ arg3: 2nd number
28
+ etc."
29
+ Write a script to solve 1+1,"```python
30
+ result = 1+1
31
+ ```"
32
+ Write a py script to find the World Record in SMB1 Any%,"Sure! To do so, we can use the Sure! To do so, we can use the SRC API!
33
+ ```python
34
+ import requests
35
+ from math import floor
36
+
37
+ game = 'smb1'
38
+ category = 'any'
39
+ url = f""https://www.speedrun.com/api/v1/leaderboards/{game}/category/{category}?top=1""