/python-kata

Just practicing python

Primary LanguagePython

Python Kata

I want to get jobs that have python in their stack. Python is dope because it's basically the nodejs of ai and data science.

I asked ChatGPT to challenge me with Python challenges. For each challenge, hand-wrote a solution, using google to check on python syntax and common utilities.

I hope to use these katas to help me find a job where I can play with data, do more AI stuff, computer vision, LLMs, etc.

Determine if two strings are anagrams of each other

python check_anagram.py -a listen -b silent
> True
python check_anagram.py -a listen -b speech
> False

Write a script to merge two Python dictionaries

python dict_merge.py
> ['a', 'b', 'c', '1', '2', '3', 'doe', 'rae', 'mee', 'you', 'and', 'me', 'girl']

fib(n)

python fibn.py -n 10
> 0
> 1
> 1
> 2
> 3
> 5
> 8
> 13
> 21
> 34
> 55
> 89

Write a Python script that reads a file and prints its contents, then writes a new line to it

python file_rw.py --filename rw_test.txt

FizzBuzz

python fizzbuzz.py -n 0
python fizzbuzz.py -n 1
python fizzbuzz.py -n 2
python fizzbuzz.py -n 3
> Fizz
python fizzbuzz.py -n 4
python fizzbuzz.py -n 5
> Buzz
python fizzbuzz.py -n 6
> Fizz
python fizzbuzz.py -n 7
python fizzbuzz.py -n 8
python fizzbuzz.py -n 9
> Fizz
python fizzbuzz.py -n 10
> Buzz
python fizzbuzz.py -n 11
python fizzbuzz.py -n 12
> Fizz
python fizzbuzz.py -n 13
python fizzbuzz.py -n 14
python fizzbuzz.py -n 15
> FizzBuzz

Given a list of numbers, find the missing number in the sequence

python missing_seq.py --nums 1,2,3,4,6,7,8
> 5
python missing_seq.py --nums 100,101,102,104,105,107
> 103

Check if a given string is a palindrome

python palindrome.py --string madam
> True
python palindrome.py --string mister
> False

Given a string, reverse the string and prints out every second letter

python rev_compact.py --string "Hello, world"
> drw,le

Write a Python program to reverse a string

python revstring.py --string "Hello, world"
> dlrow ,olleH