This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyinputplus | |
from pyinputplus import * | |
def intro(): | |
pass | |
intro() | |
#--Room start: Snow Whites Chambers function | |
global user_direction, items, inventory, item | |
# noinspection PyRedeclaration | |
items = ['pie', 'crowbar', 'potion', 'uniform', 'keys', 'spellbook'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title> | |
<!--This is what will be displayed at the top of your page--> | |
</title> | |
</head> | |
<body> | |
<h1>This is a Heading</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user_input = input() | |
hourly_temperature = user_input.split() | |
hour_temp = len(hourly_temperature) | |
#create an empty list | |
temps = [] | |
if hour_temp >= 0: | |
for i in hourly_temperature: #question on i and appends i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user_input= input() | |
lines = user_input.split(',') | |
# This line uses a construct called a list comprehension, introduced elsewhere, | |
# to convert the input string into a two-dimensional list. | |
# Ex: 1 2, 2 4 is converted to [ [1, 2], [2, 4] ] | |
mult_table = [[int(num) for num in line.split()] for line in lines] | |
for row in mult_table: | |
print(" | ".join([str(cell) for cell in row])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#A dictionary for the simplified dragon text game | |
#The dictionary links a room to other rooms. | |
rooms = { | |
'Great Hall': {'South': 'Bedroom'}, | |
'Bedroom': {'North': 'Great Hall', 'East': 'Cellar'}, | |
'Cellar': {'West': 'Bedroom'} | |
} | |
print('\n' * 10) | |
print('Your starting and current location is the Great Hall.\n') | |
# noinspection PyRedeclaration |