Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Molal/sharing

Repository files navigation

Introduction to Python: Open Source IT-USA

Facilatator: Goerge Migot image

Assignment 8 import json, requests data='https://raw.githubusercontent.com/normansimonr/Dumb-Cogs/master/lolz/data/tranzlashun.json' resp=requests.get(data) dictionary=json.loads(resp.text) #print(dictionary)

dictionary = { "Marijuan": "Ndukulu", "Gang": "Geri", "Ciggarrette": "Gife", "Money": "Dache", "Pocket": "Mbosho", "Friend": "Fafiri", "Scavenge": "Hamoch", "Tea": "Icha", "Come": "Kamuthe", "Player": "Lovito", "Rastamen": "Mabingi", "Judge": "Jajiko", "Job": "Jobiso" } word = input("Original word:") if word in dictionary: print("The translation is:", dictionary[word]) else: print("sory, the word has no translation in the dictionary.")

f = open("dictionary", "a") f.write(str({ "Marijuan": "Ndukulu", "Gang": "Geri", "Ciggarrette": "Gife", "Money": "Dache", "Pocket": "Mbosho", "Friend": "Fafiri", "Scavenge": "Hamoch", "Tea": "Icha", "Come": "Kamuthe", "Player": "Lovito", "Rastamen": "Mabingi", "Judge": "Jajiko", "Job": "Jobiso" })) f.close()

#open and read the file after the appending: f = open("dictionary", "r") print(f.read()) f.close()

AltStyle によって変換されたページ (->オリジナル) /