Skip to content

Instantly share code, notes, and snippets.

View kazazakifire's full-sized avatar

HappyPagan kazazakifire

View GitHub Profile
# Write a Python program that accepts the name of a student, matric number, course code and the score he/she got in the course. E.g
# Name: John Alfred
# Matric. No.: MUC/CS/014/0882
# Course Code: CMP 212
# Score: 100
# The program then print the result as:
# John Alfred, MUC/CS/014/0882, CMP 212, Grade A
# [/left]
# [left]
@kazazakifire
kazazakifire / spacedOut.py
Created May 24, 2020 23:41
Spaced out - Turns spaces to underscores
userInput = input('Enter a sentence: ')
output = ''
for c in userInput:
if c==' ':
output = output + '_'
continue
output = output + c
@kazazakifire
kazazakifire / urlParser.py
Created May 24, 2020 23:32
URL domain parser
url = "https://www.makeuseof.com/tag/browser-text-based-games/"
fullStopIndex = url.find('.')
forwardSlashIndex = url[fullStopIndex:].find('/')
domain = url[fullStopIndex + 1:fullStopIndex + forwardSlashIndex]
print(domain)