August 2021
Beginner to intermediate
112 pages
1h 29m
English
| Puzzle 13 | A 10% Discount |
| | import pandas as pd |
| | |
| | df = pd.DataFrame([ |
| | ['Bugs', True, 72.3], |
| | ['Daffy', False, 30.7], |
| | ['Tweety', True, 23.5], |
| | ['Elmer', False, 103.9], |
| | ], columns=['Customer', 'Member', 'Amount']) |
| | |
| | df[df['Member']]['Amount'] *= 0.9 |
| | print(df) |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
This code will print a warning and then
| | Customer Member Amount |
| | 0 Bugs True 72.3 |
| | 1 Daffy False 30.7 |
| | 2 Tweety True 23.5 |
| | 3 Elmer False 103.9</code></pre></td> ... |
Read now
Unlock full access