Skip to content

Instantly share code, notes, and snippets.

klamfa

Block or report user

Report or block klamfa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Homework_6-1.py
class BasketballPlayer:
def __init__(self, first_name, last_name, height_cm, weight_kg):
self.first_name = first_name
self.last_name = last_name
self.height_cm = height_cm
self.weight_kg = weight_kg
with open("player_database.txt", "w") as database:
database.write(str(self.__dict__))
View Dict_countries_capitals.txt
{"Albania":"Tirana",
"Andorra":"Andorra la Vella",
"Armenia":"Yerevan",
"Austria":"Vienna",
"Azerbaijan":"Baku",
"Belarus":"Minsk",
"Belgium":"Brussels",
"Bosnia and Herzegovina":"Sarajevo",
"Bulgaria":"Sofia",
"Croatia":"Zagreb",
View European_countries_list.txt
{"Albania":"Tirana",
"Andorra":"Andorra la Vella",
"Armenia":"Yerevan",
"Austria":"Vienna",
"Azerbaijan":"Baku",
"Belarus":"Minsk",
"Belgium":"Brussels",
"Bosnia and Herzegovina":"Sarajevo",
"Bulgaria":"Sofia",
"Croatia":"Zagreb",
View secret_functions_levels.py
import random
import json
import datetime
def play_game(level):
secret = random.randint(1, 30)
attempts = 0
wrong_guesses = []
players_name = str(input("What is your name? Type here:"))
View Forensics_program.py
all_hair_colors = {"black_hair": "CCAGCAATCGC", "brown_hair": "GCCAGTGCCG", "blonde_hair": "TTAGCTATCGC"}
all_face_shapes = {"square_face": "GCCACGG", "round_face": "ACCACAA", "oval_face": "AGGCCTCA"}
all_eye_colors = {"blue_eyes": "TTGTGGTGGC", "green_eyes": "GGGAGGTGGC", "brown_eyes": "AAGTAGTGAC"}
all_genders = {"female": "TGAAGGACCTTC", "male": "TGCAGGAACTTC"}
all_races = {"white": "AAAACCTCA", "black": "CGACTACAG", "asian": "CGCGGGCCG"}
eva = {"name": "Eva", "gender": "female", "race": "white", "hair_color": "blonde_hair", "eye_color": "blue_eyes",
"face_shape": "oval_face"}
larisa = {"name": "Larisa", "gender": "female", "race": "white", "hair_color": "brown_hair", "eye_color": "brown_eyes",
"face_shape": "oval_face"}
View Homework 2-1.py
do_convert = "yes"
print("Welcome to the km to mi converter!")
while do_convert == "yes":
kilometers = int(input("How many kilometers do you want to convert to miles? "))
miles = kilometers * 0.621371
print (str(kilometers) + " km is " + str(miles) + " mi!")
do_convert = input("Would you like to make another conversion? Enter yes or no here: ")
@klamfa
klamfa / Homework 1-1.py
Last active Oct 28, 2019
MVisnikar Homework 1
View Homework 1-1.py
mood = input("How are you feeling? I don't have that much emotional inteligence, so your options are: happy, sad, excited, relaxed and nervous! Enter one here! ")
if mood == "happy":
print("It is great to see you happy!")
elif mood == "sad":
print("Watch an episode of Friends, it'll help.")
elif mood == "excited":
print("I'm excited you're excited!.")
elif mood == "relaxed":
print("Chill with your friends!")
You can’t perform that action at this time.