Skip to content

Instantly share code, notes, and snippets.

View Pythonian's full-sized avatar
🏠
Coding

Seyi Pythonian Pythonian

🏠
Coding
  • Lagos, Nigeria
  • 09:38 (UTC +01:00)
  • X @Ajibel
View GitHub Profile
import string
def read_file_content(filename):
with open(filename, 'r') as f:
text = f.read()
return text
def count_words():
text = read_file_content("./story.txt")
words = []
class Student:
def __init__(self, name: str, age: int, tracks: list, score: float):
self.name = name
self.age = age
self.tracks = tracks
self.score = score
def change_name(self, name):
print(name)
def find_anagram(word, anagram):
if sorted(word) == sorted(anagram):
print(f"TRUE::: '{word} and {anagram}' are anagrams of each other.")
else:
print(f"FALSE::: The two strings '{word} and {anagram}' contradict each other.")
if __name__ == "__main__":
find_anagram("below", "elbow")
find_anagram("hello", "check")
@Pythonian
Pythonian / rock_paper_scissors.py
Created June 9, 2022 14:12
Task Title: Creating and Using [Local] Python Packages
import random
game_choices = ["R", "P", "S"]
print("Let's [R]ock, [P]aper, [S]cissors!!!\n")
while True:
computer_choice = random.choice(game_choices)
player_choice = str(input("Your choice of letter? "))
@Pythonian
Pythonian / javascript_intro.html
Created June 21, 2022 16:28
Zuri Task Title: Introduction to Javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Task Title: Introduction to Javascript</title>
</head>
<body>
<script>
let name, height, country;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Javascript calculator</title>
</head>
<body>
<script>
// holds the kind of arithmetic operation to be performed