Download pool/shard009/Python/0080315_mataSet2.py from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 838 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard009/Python/0080315_mataSet2.py
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard009/Python/0080315_mataSet2.py
-
curl -L -o 0080315_mataSet2.py https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard009/Python/0080315_mataSet2.py
838 Bytes
| #!/usr/bin/python | |
| # Write a function that takes two equal-length buffers and produces their XOR combination. | |
| # | |
| # If your function works properly, then when you feed it the string: | |
| # | |
| # 1c0111001f010100061a024b53535009181c | |
| # ... after hex decoding, and when XOR'd against: | |
| # | |
| # 686974207468652062756c6c277320657965 | |
| # | |
| # ... should produce: | |
| # | |
| # 746865206b696420646f6e277420706c6179 | |
| def xThenor(num1,num2): | |
| # Step 1: Are they the same len | |
| if len(num1)!=len(num2): | |
| return "They are not the same length try again BRO!!!!!!" | |
| else: | |
| print("Got it coach numbers look good, now it time to use my trusty decoder ring!") | |
| # Step 2: Hex and XOR the inputed values | |
| return '%x' % (int(num1,16)^int(num2,16)) | |
| number1=raw_input("First Number\n> ") | |
| number2=raw_input("Second Number\n> ") | |
| x = xThenor(number1,number2) | |
| print x | |