This file contains hidden or 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
| CREATE DATABASE "Losty"; | |
| CREATE TABLE "Customer" ( | |
| "ID" INTEGER PRIMARY KEY AUTOINCREMENT, | |
| "First_name" TEXT, | |
| "Last_name" TEXT, | |
| "Email" TEXT, | |
| "Phone_number" TEXT | |
| ); |
This file contains hidden or 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
| SELECT MAX (Invoice.Total), * | |
| FROM Invoice; | |
| SELECT MIN (Invoice.Total), * | |
| FROM Invoice; | |
| SELECT COUNT(Invoice.BillingCity) AS Invoice_num, Invoice.BillingCity | |
| FROM Invoice | |
| GROUP BY Invoice.BillingCity | |
| ORDER BY Invoice_num DESC; |
This file contains hidden or 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
| Select Name | |
| From Artist; | |
| Select * | |
| From Invoice | |
| Where Invoice.BillingCountry='Germany'; | |
| Select count (*) | |
| From Album; |
This file contains hidden or 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
| SELECT Count (*) | |
| From Teilnahme | |
| Where Teilnahme.Essensauswahl='Fleisch'; |
This file contains hidden or 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 random | |
| secret = 28 | |
| print "Welcome to 'Guess the secret number'" | |
| def main(): | |
| while True: | |
| random_num = random.randint(0, 29) | |
| print "You don't know which number you want to choose? You can take our randomly created number:" " " \ |
This file contains hidden or 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
| country_capital_dict = {"Slovenia": "Ljubljana", "Croatia": "Zagreb", "Austria": "Vienna"} | |
| def main(): | |
| country_capital_dict = {"Slovenia": "Ljubljana", "Croatia": "Zagreb", "Austria": "Vienna"} | |
| while True: | |
| selected_country = country_capital_dict.keys()[0] | |
| guess = raw_input("What is the capital of %s? " % selected_country) |
This file contains hidden or 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
| print "TODAY'S MENU\n" | |
| menu_dict = {} | |
| while True: | |
| dish = raw_input("Please enter today's dish: ") | |
| price = raw_input("Please enter the price of that dish: EUR ") | |
| if dish == True: | |
| menu_dict[dish] = True |
This file contains hidden or 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
| print "Hello, I'm converting kilometers into miles.\n" | |
| kilometres = raw_input("Please enter the amount of kilometres: ") | |
| miles = float(kilometres) * 0.621372 | |
| print miles | |
| answer = raw_input("Do you want to do another conversion? ") | |
| while answer == "yes": | |
| kilometres = raw_input("Please enter the amount of kilometres: ") |
This file contains hidden or 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
| secret = 28 | |
| guess = int(raw_input("Guess the secret number: ")) | |
| if guess == secret: | |
| print "Congratulations!!!" | |
| else: | |
| print "Sorry, wrong number. Try it again!" |