Question

In: Computer Science

Convert from python 2 to 3 from Tkinter import * # the blueprint for a room...

Convert from python 2 to 3

from Tkinter import *

# the blueprint for a room
class Room(object):
# the constructor
def __init__(self,name,image):
# rooms have a name, exits (e.g., south), exit locations (e.g., to the south is room n),
# items (e.g., table), item descriptions (for each item), and grabbables (things that can
# be taken and put into the inventory)
self.name = name
self.image = image
self.exits = {}
self.items = {}
self.grabbables = []

# getters and setters for the instance variables
@property
def name(self):
return self._name

@name.setter
def name(self, value):
self._name = value

@property
def image(self):
return self._image

@image.setter
def image(self, value):
self._image = value

@property
def exits(self):
return self._exits

@exits.setter
def exits(self, value):
self._exits = value

@property
def items(self):
return self._items

@items.setter
def items(self, value):
self._items = value

@property
def grabbables(self):
return self._grabbables

@grabbables.setter
def grabbables(self, value):
self._grabbables = value

# adds an exit to the room
# the exit is a string (e.g., north)
# the room is an instance of a room
def addExit(self, exit, room):
# append the exit and room to the appropriate lists
self.exits[exit] = room

# adds an item to the room
# the item is a string (e.g., table)
# the description is a string that describes the item (e.g., it is made of wood)
def addItem(self,item, desc):
# append the tiem and description to the appropriate lists
self._items[item] = desc

# removes a grabbable item from the room
# the item is a string (e.g., key)
def addGrabbable(self, item):
# append the item to the list
self._grabbables.append(item)

# removes a grabbable item from the room
# the item is a string (e.g., key)
def delGrabbable(self, item):
# remove the item from the list
self._grabbables.remove(item)

# returns a string description of the room
def __str__(self):
# first, the room name
s = "You are in {}.\n".format(self.name)

# next, the items in the room
s += "You see: "
for item in self.items.keys():
s += item + " "

s += "\n"

# next, the grabbables in the room
## Added Print Statement ##
s += "You can take: "
for grabbables in self.grabbables:
s += grabbables + " "
s += "\n"

# next, the exits for the room
s += "Exits: "
for exit in self.exits.keys():
s += exit + " "
s += "\n"
return s

#####################################
class Game(Frame):
def __init__(self, parent):
Frame.__init__(self, parent)

def createRooms(self):
# r1 through r9 are the nine rooms in the mansion
# currentRoom is the room the player is currently in
# (which # can be one of r1 through r4)
# create the rooms and give them meaningful names and an
# image in the current directory
  
r1 = Room("the Red Room", "red.gif")
r2 = Room("the Orange Room", "orange.gif")
r3 = Room("the Yellow Room", "yellow.gif")
r4 = Room("the Green Room", "green.gif")
r5 = Room("the Blue Room", "blue.gif")
r6 = Room("the Purple Room", "purple.gif")
r7 = Room("the Brown Room", "brown.gif")
r8 = Room("the Pink Room", "pink.gif")
r9 = Room("the White Room", "white.gif")

######## Red Room ################
  
r1.addExit("east", r2)
r1.addExit("south", r3)

r1.addItem(" red_chair", "It is made of red suede and no one is sitting on it.")
r1.addItem("table", "It is made of oak. A golden key rests on it.")
r1.addItem("chandelier", "There are two chandeliers, both of which are lit.")
  
r1.addGrabbable("key")

######## Orange Room ################
  
r2.addExit("west", r1)
r2.addExit("south", r4)
r2.addExit("east", r5)
  
r2.addItem("rug", "It is nice and fluffy. It also needs to be vacuumed.")
r2.addItem("lamp", "It is off; maybe you should turn it on.")
r2.addItem("couch", "There are butt grooves in the cushions.")

r2.addGrabbable("pillow")
r2.addGrabbable("bowl")
  
####### Yellow Room ##################
  
r3.addExit("north", r1)
r3.addExit("east", r4)
r3.addExit("west", r6)
  
r3.addItem("picture", "It is a simple picture in a white picture frame.")
r3.addItem("chair", "There is no back to this chair... It is an unusual chair. There\
is a jacket laying on the chair.")

r3.addGrabbable("jacket")
  
############# Green Room #############
  
r4.addExit("north", r2)
r4.addExit("west", r3)
r4.addExit("south", None)
r4.addExit("east", r9)
  
r4.addItem("couch", "It has a couple pillows on it.. It's also black... Nothing special.")
r4.addItem("light", "I don't even know if it has a light bulb in it.")
r4.addItem("plant", "It is green and leafy.")
r4.addItem("table", "There are two tables. One has drinks on it, and the other has\
a bowl and two books.")
  
r4.addGrabbable("pillow")
r4.addGrabbable("watering_can")
r4.addGrabbable("bowl")


########## Blue Room ####################
  
r5.addExit("west", r2)
r5.addExit("east", r7)
r5.addExit("south", r9)

r5.addItem("chair", "It is blue and looks very comfy.")
r5.addItem("painting", "It has an interesting face on it.")
r5.addItem("nightstand", "It is a light beige color. It has some magazines on it.")

r5.addGrabbable("magazine")
  
############ Purple Room ##################

r6.addExit("east", r3)
r6.addExit("south", r8)

r6.addItem("picture", "There is a pretty fox drawn inside of a white picture frame.")
r6.addItem("dresser", "It is a white dresser with 6 drawers. A couple of \
different items are on top of the dresser.")
r6.addItem("window", "It looks bright outside.")

r6.addGrabbable("alarm_clock")
r6.addGrabbable("silicon_mushroom")

############## Brown Room #################

r7.addExit("west", r5)

r7.addItem("stairs", "These stairs look very elegant.")
r7.addItem("carpet", "This carpet feels so good on bare feet.")
r7.addItem("statue", "This horse staue is made out of bronze.")
r7.addItem("fireplcae", "There is a nice plant placement on the shelf\
above the fireplace. But... it is cold.. someone should put some firewood inside\
and light a fire.")
r7.addItem("window", "Look out the window, there might be a fluffy kitty in the yard.")

r7.addGrabbable("blanket")


###### Pink Room ####################
  
r8.addExit("north", r6)

r8.addItem("chair", "There are two pink charis. They look super comfy.")
r8.addItem("table", "There is a pink table. It has a couple of items on it.")
r8.addItem("decorations", "What are these interesting pink decorations on the ceiling??")

r8.addGrabbable("plate")
r8.addGrabbable("fluff")


############# White Room ##################

r9.addExit("north", r5)
r9.addExit("west", r4)

r9.addItem("couch","THere are two couches facing eachother. They are grey with\
white pand grey pillows on them.")
r9.addItem("lamp", "It is a normal, modern lamp that is white.")
r9.addItem("vase", "There are white tulips inside of this skinny vase.")

r9.addGrabbable("tulip")   

###################################
  
# set room 1 as the current room at the beginning of the game
Game.currentRoom = r1
# initialize the player's inventory
Game.inventory = []

def setUpGui(self):
self.pack(fill = BOTH, expand = 1)

Game.player_input = Entry(self, bg="white")
Game.player_input.bind("<Return>", self.process)
Game.player_input.pack(side=BOTTOM, fill=X)
Game.player_input.focus()

img = None

Game.image = Label(self,width=2*WIDTH/3, image = img)
Game.image.image = img
Game.image.pack(side=LEFT, fill=Y)
Game.image.pack_propagate(False)

text_frame = Frame(self,width=WIDTH/3)
Game.text = Text(text_frame, bg="white", state=DISABLED)
Game.text.pack(fill=Y, expand=1)
text_frame.pack(side=RIGHT, fill=Y)
text_frame.pack_propagate(False)
  

def setRoomImage(self):
if (Game.currentRoom == None):
Game.img = PhotoImage(file="skull.gif")
else:
Game.img = PhotoImage(file=Game.currentRoom.image)
Game.image.config(image=Game.img)
Game.image.image = Game.img

def setStatus(self, status):
Game.text.config(state = NORMAL)
Game.text.delete("1.0", END)

if (Game.currentRoom == None):
Game.text.insert(END, "You are dead. Quit now")
else:
Game.text.insert(END, str(Game.currentRoom) + \
"You are carrying: " + str(Game.inventory)\
+ status + "\n")
Game.text.config(state = DISABLED)
  

def play(self):
self.createRooms()
self.setUpGui()
self.setRoomImage()
self.setStatus("")

def process(self, event):
action = Game.player_input.get()
action = action.lower()

response = "I don't understand. Try verb noun. Valid verbs are go, look, and take"

if (action == "quit" or action == "exit" or action == "bye" or action == "sionara!"):
exit(0)
if (Game.currentRoom == None):
Game.player_input.delete(0,END)
return
words = action.split()

if(len(words) == 2):
verb = words[0]
noun = words[1]

if (verb == "go"):
response = "\nInvalid exit."

if (noun in Game.currentRoom.exits):
Game.currentRoom = Game.currentRoom.exits[noun]
response = "\nRoom changed."
elif (verb == "look"):
# set a default response
response = "\nI don't see that item."
# check for valid items in the current room
if (noun in Game.currentRoom.items):
# if one is found, set the response to the
# item's description
response = Game.currentRoom.items[noun]
# the verb is: take
elif (verb == "take"):
# set a default response
response = "\nI don't see that item."
# check for valid grabbable items in the current room
for grabbable in Game.currentRoom.grabbables:
# a valid grabbable item is found
if (noun == grabbable):
# add the grabbable item to the player's
# inventory
Game.inventory.append(grabbable)
# remove the grabbable item from the
# room
Game.currentRoom.delGrabbable(grabbable)
# set the response (success)
response = "\nItem grabbed."
# no need to check any more grabbable
# items break
# display the response on the right of the GUI
# display the room's image on the left of the GUI
# clear the player's input
self.setStatus(response)
self.setRoomImage()
Game.player_input.delete(0, END)
  

################MAIN################3
WIDTH = 800
HEIGHT = 600

window = Tk()
window.title("Room Adventure....Reloaded")

g = Game(window)
g.play()

window.mainloop()

Solutions

Expert Solution

from tkinter import *
import pdb; pdb.set_trace()


# the blueprint for a room
class Room(object):
# the constructor
def __init__(self,name,image):
# rooms have a name, exits (e.g., south), exit locations (e.g., to the south is room n),
# items (e.g., table), item descriptions (for each item), and grabbables (things that can
# be taken and put into the inventory)
self.name = name
self.image = image
self.exits = {}
self.items = {}
self.grabbables = []

# getters and setters for the instance variables
@property
def name(self):
return self._name

@name.setter
def name(self, value):
self._name = value

@property
def image(self):
return self._image

@image.setter
def image(self, value):
self._image = value

@property
def exits(self):
return self._exits

@exits.setter
def exits(self, value):
self._exits = value

@property
def items(self):
return self._items

@items.setter
def items(self, value):
self._items = value

@property
def grabbables(self):
return self._grabbables

@grabbables.setter
def grabbables(self, value):
self._grabbables = value

# adds an exit to the room
# the exit is a string (e.g., north)
# the room is an instance of a room
def addExit(self, exit, room):
# append the exit and room to the appropriate lists
self.exits[exit] = room

# adds an item to the room
# the item is a string (e.g., table)
# the description is a string that describes the item (e.g., it is made of wood)
def addItem(self,item, desc):
# append the tiem and description to the appropriate lists
self._items[item] = desc

# removes a grabbable item from the room
# the item is a string (e.g., key)
def addGrabbable(self, item):
# append the item to the list
self._grabbables.append(item)

# removes a grabbable item from the room
# the item is a string (e.g., key)
def delGrabbable(self, item):
# remove the item from the list
self._grabbables.remove(item)

# returns a string description of the room
def __str__(self):
# first, the room name
s = "You are in {}.\n".format(self.name)

# next, the items in the room
s += "You see: "
for item in self.items.keys():
s += item + " "

s += "\n"

# next, the grabbables in the room
## Added Print Statement ##
s += "You can take: "
for grabbables in self.grabbables:
s += grabbables + " "
s += "\n"

# next, the exits for the room
s += "Exits: "
for exit in self.exits.keys():
s += exit + " "
s += "\n"
return s

#####################################
class Game(Frame):
def __init__(self, parent):
Frame.__init__(self, parent)

def createRooms(self):
# r1 through r9 are the nine rooms in the mansion
# currentRoom is the room the player is currently in
# (which # can be one of r1 through r4)
# create the rooms and give them meaningful names and an
# image in the current directory
  
r1 = Room("the Red Room", "red.gif")
r2 = Room("the Orange Room", "orange.gif")
r3 = Room("the Yellow Room", "yellow.gif")
r4 = Room("the Green Room", "green.gif")
r5 = Room("the Blue Room", "blue.gif")
r6 = Room("the Purple Room", "purple.gif")
r7 = Room("the Brown Room", "brown.gif")
r8 = Room("the Pink Room", "pink.gif")
r9 = Room("the White Room", "white.gif")

######## Red Room ################
  
r1.addExit("east", r2)
r1.addExit("south", r3)

r1.addItem(" red_chair", "It is made of red suede and no one is sitting on it.")
r1.addItem("table", "It is made of oak. A golden key rests on it.")
r1.addItem("chandelier", "There are two chandeliers, both of which are lit.")
  
r1.addGrabbable("key")

######## Orange Room ################
  
r2.addExit("west", r1)
r2.addExit("south", r4)
r2.addExit("east", r5)
  
r2.addItem("rug", "It is nice and fluffy. It also needs to be vacuumed.")
r2.addItem("lamp", "It is off; maybe you should turn it on.")
r2.addItem("couch", "There are butt grooves in the cushions.")

r2.addGrabbable("pillow")
r2.addGrabbable("bowl")
  
####### Yellow Room ##################
  
r3.addExit("north", r1)
r3.addExit("east", r4)
r3.addExit("west", r6)
  
r3.addItem("picture", "It is a simple picture in a white picture frame.")
r3.addItem("chair", "There is no back to this chair... It is an unusual chair. There\
is a jacket laying on the chair.")

r3.addGrabbable("jacket")
  
############# Green Room #############
  
r4.addExit("north", r2)
r4.addExit("west", r3)
r4.addExit("south", None)
r4.addExit("east", r9)
  
r4.addItem("couch", "It has a couple pillows on it.. It's also black... Nothing special.")
r4.addItem("light", "I don't even know if it has a light bulb in it.")
r4.addItem("plant", "It is green and leafy.")
r4.addItem("table", "There are two tables. One has drinks on it, and the other has\
a bowl and two books.")
  
r4.addGrabbable("pillow")
r4.addGrabbable("watering_can")
r4.addGrabbable("bowl")


########## Blue Room ####################
  
r5.addExit("west", r2)
r5.addExit("east", r7)
r5.addExit("south", r9)

r5.addItem("chair", "It is blue and looks very comfy.")
r5.addItem("painting", "It has an interesting face on it.")
r5.addItem("nightstand", "It is a light beige color. It has some magazines on it.")

r5.addGrabbable("magazine")
  
############ Purple Room ##################

r6.addExit("east", r3)
r6.addExit("south", r8)

r6.addItem("picture", "There is a pretty fox drawn inside of a white picture frame.")
r6.addItem("dresser", "It is a white dresser with 6 drawers. A couple of \
different items are on top of the dresser.")
r6.addItem("window", "It looks bright outside.")

r6.addGrabbable("alarm_clock")
r6.addGrabbable("silicon_mushroom")

############## Brown Room #################

r7.addExit("west", r5)

r7.addItem("stairs", "These stairs look very elegant.")
r7.addItem("carpet", "This carpet feels so good on bare feet.")
r7.addItem("statue", "This horse staue is made out of bronze.")
r7.addItem("fireplcae", "There is a nice plant placement on the shelf\
above the fireplace. But... it is cold.. someone should put some firewood inside\
and light a fire.")
r7.addItem("window", "Look out the window, there might be a fluffy kitty in the yard.")

r7.addGrabbable("blanket")


###### Pink Room ####################
  
r8.addExit("north", r6)

r8.addItem("chair", "There are two pink charis. They look super comfy.")
r8.addItem("table", "There is a pink table. It has a couple of items on it.")
r8.addItem("decorations", "What are these interesting pink decorations on the ceiling??")

r8.addGrabbable("plate")
r8.addGrabbable("fluff")


############# White Room ##################

r9.addExit("north", r5)
r9.addExit("west", r4)

r9.addItem("couch","THere are two couches facing eachother. They are grey with\
white pand grey pillows on them.")
r9.addItem("lamp", "It is a normal, modern lamp that is white.")
r9.addItem("vase", "There are white tulips inside of this skinny vase.")

r9.addGrabbable("tulip")   

###################################
  
# set room 1 as the current room at the beginning of the game
Game.currentRoom = r1
# initialize the player's inventory
Game.inventory = []

def setUpGui(self):
self.pack(fill = BOTH, expand = 1)

Game.player_input = Entry(self, bg="white")
Game.player_input.bind("<Return>", self.process)
Game.player_input.pack(side=BOTTOM, fill=X)
Game.player_input.focus()

img = None

Game.image = Label(self,width=2*WIDTH/3, image = img)
Game.image.image = img
Game.image.pack(side=LEFT, fill=Y)
Game.image.pack_propagate(False)

text_frame = Frame(self,width=WIDTH/3)
Game.text = Text(text_frame, bg="white", state=DISABLED)
Game.text.pack(fill=Y, expand=1)
text_frame.pack(side=RIGHT, fill=Y)
text_frame.pack_propagate(False)
  

def setRoomImage(self):
if (Game.currentRoom == None):
Game.img = PhotoImage(file="skull.gif")
else:
Game.img = PhotoImage(file=Game.currentRoom.image)
Game.image.config(image=Game.img)
Game.image.image = Game.img

def setStatus(self, status):
Game.text.config(state = NORMAL)
Game.text.delete("1.0", END)

if (Game.currentRoom == None):
Game.text.insert(END, "You are dead. Quit now")
else:
Game.text.insert(END, str(Game.currentRoom) + \
"You are carrying: " + str(Game.inventory)\
+ status + "\n")
Game.text.config(state = DISABLED)
  

def play(self):
self.createRooms()
self.setUpGui()
self.setRoomImage()
self.setStatus("")

def process(self, event):
action = Game.player_input.get()
action = action.lower()

response = "I don't understand. Try verb noun. Valid verbs are go, look, and take"

if (action == "quit" or action == "exit" or action == "bye" or action == "sionara!"):
exit(0)
if (Game.currentRoom == None):
Game.player_input.delete(0,END)
return
words = action.split()

if(len(words) == 2):
verb = words[0]
noun = words[1]

if (verb == "go"):
response = "\nInvalid exit."

if (noun in Game.currentRoom.exits):
Game.currentRoom = Game.currentRoom.exits[noun]
response = "\nRoom changed."
elif (verb == "look"):
# set a default response
response = "\nI don't see that item."
# check for valid items in the current room
if (noun in Game.currentRoom.items):
# if one is found, set the response to the
# item's description
response = Game.currentRoom.items[noun]
# the verb is: take
elif (verb == "take"):
# set a default response
response = "\nI don't see that item."
# check for valid grabbable items in the current room
for grabbable in Game.currentRoom.grabbables:
# a valid grabbable item is found
if (noun == grabbable):
# add the grabbable item to the player's
# inventory
Game.inventory.append(grabbable)
# remove the grabbable item from the
# room
Game.currentRoom.delGrabbable(grabbable)
# set the response (success)
response = "\nItem grabbed."
# no need to check any more grabbable
# items break
# display the response on the right of the GUI
# display the room's image on the left of the GUI
# clear the player's input
self.setStatus(response)
self.setRoomImage()
Game.player_input.delete(0, END)
  

################MAIN################
def main():
WIDTH = 800
HEIGHT = 600

window = Tk()
window.title("Room Adventure....Reloaded")

g = Game(window)
g.play()

window.mainloop()
if __name__ == "__main__":
main()


Related Solutions

Python 3 Fix the code and rovide the correct indentation Code: import tkinter as tk from...
Python 3 Fix the code and rovide the correct indentation Code: import tkinter as tk from tkcalendar import DateEntry from openpyxl import load_workbook from tkinter import messagebox from datetime import datetime window = tk.Tk() window.title("daily logs") window.grid_columnconfigure(1,weight=1) window.grid_rowconfigure(1,weight=1) # labels tk.Label(window, text="Bar code").grid(row=0, sticky="W", pady=20, padx=20) tk.Label(window, text="Products failed").grid(row=1, sticky="W", pady=20, padx=20) tk.Label(window, text="Money Lost").grid(row=2, sticky="W", pady=20, padx=20) tk.Label(window, text="sold by").grid(row=3, sticky="W", pady=20, padx=20) tk.Label(window, text="Failed date").grid(row=4, sticky="W", pady=20, padx=20) # entries barcode = tk.Entry(window) product = tk.Entry(window) money =...
Python 3 Calendar does not showing up Fix code: # required library import tkinter as tk...
Python 3 Calendar does not showing up Fix code: # required library import tkinter as tk from tkcalendar import DateEntry import xlsxwriter # frame window = tk.Tk() window.title("daily logs") #window.resizable(0,0) # labels tk.Label(window, text="Bar code").grid(row=0, sticky="W", pady=20, padx=20) tk.Label(window, text="Products failed").grid(row=1, sticky="W", pady=20, padx=20) tk.Label(window, text="Money Lost").grid(row=2, sticky="W", pady=20, padx=20) tk.Label(window, text="Failed date").grid(row=3, sticky="W", pady=20, padx=20) # entries barcode = tk.Entry(window) product = tk.Entry(window) money = tk.Entry(window) # arraging barcode.grid(row=0, column=1) product.grid(row=1, column=1) money.grid(row=2, column=1) cal = DateEntry(window, width=12, year=2019,...
Please enter flowchart. Thank you! from tkinter import * from tkinter.scrolledtext import ScrolledText #method to open...
Please enter flowchart. Thank you! from tkinter import * from tkinter.scrolledtext import ScrolledText #method to open file and load contents into text field def open_file(): #fetching file name from filenamevar StringVar filename=filenamevar.get() try: #opening file in read mode file=open(filename,'r') #reading text text=file.read() #replacing current text in textField to read text textField.replace("1.0",END,text) #closing file file.close() except: #displaying error message in textField textField.replace("1.0", END, 'File not found!') #method to save current contents of file into file mentioned in file name entry field...
Please convert this code written in Python to Java: import string import random #function to add...
Please convert this code written in Python to Java: import string import random #function to add letters def add_letters(number,phrase):    #variable to store encoded word    encode = ""       #for each letter in phrase    for s in phrase:        #adding each letter to encode        encode = encode + s        for i in range(number):            #adding specified number of random letters adding to encode            encode = encode +...
Convert this java code from hashmap into arraylist. import java.io.*; import java.util.*; public class Solution {...
Convert this java code from hashmap into arraylist. import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); HashMap labs = new HashMap(); while (true) { System.out.println("Choose operation : "); System.out.println("1. Create a Lab"); System.out.println("2. Modify a Lab"); System.out.println("3. Delete a Lab"); System.out.println("4. Assign a pc to a Lab"); System.out.println("5. Remove a pc from a Lab"); System.out.println("6. Quit"); int choice = sc.nextInt(); String name=sc.nextLine(); switch (choice) { case 1:...
1.Convert (FA)16 to decimal 2.Convert (10101110)2 to decimal. 3.Convert (0.10101)2 to decimal.
1.Convert (FA)16 to decimal 2.Convert (10101110)2 to decimal. 3.Convert (0.10101)2 to decimal.
3. Strong corporate culture, ability to adapt is best blueprint for going global: Lenovo The blueprint...
3. Strong corporate culture, ability to adapt is best blueprint for going global: Lenovo The blueprint for any company that pursues international expansion starts with building a strong entrepreneurial culture that adapts to the times, according to Chinese technology giant Lenovo Group. It is a business principle that has served Lenovo well in its decades-long transformation from a start-up electronics company in mainland China in 1984 into the world's biggest supplier of personal computers. "When a company becomes bigger, make...
Can someone convert this to C++ Please! import java.util.*; // for Random import java.util.Scanner; // for...
Can someone convert this to C++ Please! import java.util.*; // for Random import java.util.Scanner; // for Scanner class game{    public static void main(String args[])    {        // generating a random number        Random rand = new Random();        int code = rand.nextInt(99999) + 1, chances = 1, help, turn, i,match, sum;               // for input        Scanner sc = new Scanner(System.in);               // running for 10 times   ...
Using Tkinter for GUI, A Python program that will allow the user to perform (i) generate...
Using Tkinter for GUI, A Python program that will allow the user to perform (i) generate RSA keys, (ii) encrypt a given message and (iii) decrypt the message without using any cryptographic library. Your program will generate the values of p unless the user provides them manually. Then the program will generate the keys (private and public). Then the program will allow the user to enter his/her message to be encrypted. Finally, the program will perform the decryption operation as...
Programming language is in python 3 For this project, you will import the json module. Write...
Programming language is in python 3 For this project, you will import the json module. Write a class named NobelData that reads a JSON file containing data on Nobel Prizes and allows the user to search that data. It just needs to read a local JSON file - it doesn't need to access the internet. Specifically, your class should have an init method that reads the file, and it should have a method named search_nobel that takes as parameters a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT