def binary_multiply(num1, num2):
  
    num1_int = int(num1, 2)
    num2_int = int(num2, 2)

    result = bin(num1_int * num2_int)[2:]

    return result

num1 = input("Enter first binary number: ")
num2 = input("Enter second binary number: ")

result = binary_multiply(num1, num2)


print(f"{num1} x {num2} = {result}")
01 x 11 = 11
import pandas as pd


data = {
    'Name': ['Dillon', 'Noor', 'Steven', 'Lucas', 'Harsha', 'Varalu', 'Ryan', 'Emaad'],
    'Age': [24, 31, 42, 27, 29, 26, 90, 15],
    'Gender': ['M', 'M', 'M', 'M', 'F', 'F', 'F', 'F'],
    'Grade': ['A', 'B', 'A', 'D', 'C', 'F', 'B', 'A']
}


df = pd.DataFrame(data)

# function 1: get summary statistics
summary = df.describe()
print(summary)

# function 2: group by gender and get average age and grade
grouped = df.groupby('Gender').agg({'Age': 'mean', 'Grade': lambda x: x.mode()[0]})
print(grouped)

# function 3: filter by age and grade
filtered = df[(df.Age >= 30) & (df.Grade.isin(['A', 'B']))]
print(filtered)
             Age
count   8.000000
mean   35.500000
std    23.268618
min    15.000000
25%    25.500000
50%    28.000000
75%    33.750000
max    90.000000
         Age Grade
Gender            
F       40.0     A
M       31.0     A
     Name  Age Gender Grade
1    Noor   31      M     B
2  Steven   42      M     A
6    Ryan   90      F     B

<!DOCTYPE html>

Student Gender Filter

Student Gender Filter

Name Gender Grade
John Male 12
Maya Female 10
Josh Male 11
Carol Female 12
with open('valid_guesses.csv', 'r') as f:
    word_list = []
    for word in f:
        word = word.strip()
        if (word[0] not in ['a', 'b', 'c', 'd'] and word[-1] in ['a', 'b', 'c', 'd']):
            word_list.append(word)
        elif (word[0] in ['a', 'b', 'c', 'd'] and word[-1] not in ['a', 'b', 'c', 'd']):
            word_list.append(word)
        elif (word[0] not in ['a', 'b', 'c', 'd'] and word[-1] not in ['a', 'b', 'c', 'd']):
            word_list.append(word + 'ism')
    print(word_list)
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
c:\Users\nicom\Desktop\Github\APCSP\_notebooks\2023-04-28-binary-hacks.ipynb Cell 5 in <cell line: 1>()
----> <a href='vscode-notebook-cell:/c%3A/Users/nicom/Desktop/Github/APCSP/_notebooks/2023-04-28-binary-hacks.ipynb#W4sZmlsZQ%3D%3D?line=0'>1</a> with open('valid_guesses.csv', 'r') as f:
      <a href='vscode-notebook-cell:/c%3A/Users/nicom/Desktop/Github/APCSP/_notebooks/2023-04-28-binary-hacks.ipynb#W4sZmlsZQ%3D%3D?line=1'>2</a>     word_list = []
      <a href='vscode-notebook-cell:/c%3A/Users/nicom/Desktop/Github/APCSP/_notebooks/2023-04-28-binary-hacks.ipynb#W4sZmlsZQ%3D%3D?line=2'>3</a>     for word in f:

FileNotFoundError: [Errno 2] No such file or directory: 'valid_guesses.csv'
simulations = [
    {'name': 'Simulation A', 'time': 10.5, 'success': True},
    {'name': 'Simulation B', 'time': 12.3, 'success': False},
    {'name': 'Simulation C', 'time': 8.1, 'success': True},
    {'name': 'Simulation D', 'time': 9.2, 'success': True},
    {'name': 'Simulation E', 'time': 11.7, 'success': False}
]

# Sort by time and success

sorted_simulations = sorted(simulations, key=lambda s: s['time'])
sorted_simulations = sorted(simulations, key=lambda s: s['success'])
import random

# Create a list of possible outcomes
outcomes = [1, 2, 3, 4, 5, 6]

# Define the number of times to simulate the random number generator
num_simulations = 10

# Simulate the random number generator
for i in range(num_simulations):
    outcome = random.choice(outcomes)
    print(f"Simulation {i+1}: {outcome}")
Simulation 1: 4
Simulation 2: 6
Simulation 3: 2
Simulation 4: 1
Simulation 5: 2
Simulation 6: 4
Simulation 7: 5
Simulation 8: 6
Simulation 9: 5
Simulation 10: 3
from skimage import io
from matplotlib import pyplot as plt
waldo = io.imread('waldo.jpg')
plt.imshow(waldo)
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
c:\Users\nicom\Desktop\Github\APCSP\_notebooks\2023-04-28-binary-hacks.ipynb Cell 8 in <cell line: 3>()
      <a href='vscode-notebook-cell:/c%3A/Users/nicom/Desktop/Github/APCSP/_notebooks/2023-04-28-binary-hacks.ipynb#X11sZmlsZQ%3D%3D?line=0'>1</a> from skimage import io
      <a href='vscode-notebook-cell:/c%3A/Users/nicom/Desktop/Github/APCSP/_notebooks/2023-04-28-binary-hacks.ipynb#X11sZmlsZQ%3D%3D?line=1'>2</a> from matplotlib import pyplot as plt
----> <a href='vscode-notebook-cell:/c%3A/Users/nicom/Desktop/Github/APCSP/_notebooks/2023-04-28-binary-hacks.ipynb#X11sZmlsZQ%3D%3D?line=2'>3</a> waldo = io.imread('waldo.jpg')
      <a href='vscode-notebook-cell:/c%3A/Users/nicom/Desktop/Github/APCSP/_notebooks/2023-04-28-binary-hacks.ipynb#X11sZmlsZQ%3D%3D?line=3'>4</a> plt.imshow(waldo)

File c:\Users\nicom\anaconda3\lib\site-packages\skimage\io\_io.py:53, in imread(fname, as_gray, plugin, **plugin_args)
     50         plugin = 'tifffile'
     52 with file_or_url_context(fname) as fname:
---> 53     img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
     55 if not hasattr(img, 'ndim'):
     56     return img

File c:\Users\nicom\anaconda3\lib\site-packages\skimage\io\manage_plugins.py:207, in call_plugin(kind, *args, **kwargs)
    203     except IndexError:
    204         raise RuntimeError('Could not find the plugin "%s" for %s.' %
    205                            (plugin, kind))
--> 207 return func(*args, **kwargs)

File c:\Users\nicom\anaconda3\lib\site-packages\skimage\io\_plugins\imageio_plugin.py:10, in imread(*args, **kwargs)
      8 @wraps(imageio_imread)
      9 def imread(*args, **kwargs):
---> 10     return np.asarray(imageio_imread(*args, **kwargs))

File c:\Users\nicom\anaconda3\lib\site-packages\imageio\core\functions.py:265, in imread(uri, format, **kwargs)
    260     raise TypeError(
    261         'Invalid keyword argument "mode", ' 'perhaps you mean "pilmode"?'
    262     )
    264 # Get reader and read first
--> 265 reader = read(uri, format, "i", **kwargs)
    266 with reader:
    267     return reader.get_data(0)

File c:\Users\nicom\anaconda3\lib\site-packages\imageio\core\functions.py:172, in get_reader(uri, format, mode, **kwargs)
    149 """ get_reader(uri, format=None, mode='?', **kwargs)
    150 
    151 Returns a :class:`.Reader` object which can be used to read data
   (...)
    168     to see what arguments are available for a particular format.
    169 """
    171 # Create request object
--> 172 request = Request(uri, "r" + mode, **kwargs)
    174 # Get format
    175 if format is not None:

File c:\Users\nicom\anaconda3\lib\site-packages\imageio\core\request.py:124, in Request.__init__(self, uri, mode, **kwargs)
    121     raise ValueError('Request requires mode[1] to be in "iIvV?"')
    123 # Parse what was given
--> 124 self._parse_uri(uri)
    126 # Set extension
    127 if self._filename is not None:

File c:\Users\nicom\anaconda3\lib\site-packages\imageio\core\request.py:260, in Request._parse_uri(self, uri)
    257 if is_read_request:
    258     # Reading: check that the file exists (but is allowed a dir)
    259     if not os.path.exists(fn):
--> 260         raise FileNotFoundError("No such file: '%s'" % fn)
    261 else:
    262     # Writing: check that the directory to write to does exist
    263     dn = os.path.dirname(fn)

FileNotFoundError: No such file: 'c:\Users\nicom\Desktop\Github\APCSP\_notebooks\waldo.jpg'