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
largest = 0 # set largest number | |
number = int(input("Enter a number: ")) # get first number | |
while number != 0: # if number is not 0 | |
if number > largest: # if number is greater than the biggest so far | |
largest = number # make the largest equal to this number | |
number = int(input("Enter a number: ")) # ask for next number | |
print("the largest number was", largest) # print the largest number | |
year = int(input("Enter a year (eg. 2016): ")) # get the year | |
month = input("Enter a month (eg. November): ").capitalize() # make the first letter a capital |
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
def exercise_04 (): | |
print(" Exercise 04 - Savings Calculator") | |
balance = input(" 1. Enter your current balance: ",type=float) | |
interestPercent = input(" 3. Enter your interest rate (%): ",type=float) | |
target = input(" 2. Enter number of years: ",type=int) | |
years = 0 | |
while (years < target): | |
interest = balance * interestPercent/100 | |
balance = balance + interest | |
years = years + 1 |
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
def exercise_02 (): | |
print(" Exercise 02 - Shipping Charges Calculator") | |
weight = input(" Enter the mass of the package (kg): ",type=float) | |
while not (weight > 0 and weight <= 30): | |
weight = input(" Invalid mass. Try again: ",type=float) | |
method = input(" Enter shipping method (A|S): ",type=str).upper() | |
while not (method in ['A','S']): | |
method = input(" Invalid shipping method: ",type=str) |
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
while True: | |
seasons = ["Winter","Spring","Summer","Autumn"] | |
months = [ | |
["December","January","February"], | |
["March","April","May"], | |
["June","July","August"], | |
["September","October","November"] | |
] | |
thirtyone = ["January","March","May","July","August","October","December"] | |
thirty = ["April","June","September","November"] |
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
$(window).resize(function(){ | |
width = $(this).width(); | |
map = $('div#map'); | |
imgWidth = $('div#map img').width(); | |
scale = width / imgWidth; | |
transform = 'translateY(-'+10/scale+'%) translateX(-'+10/scale+'%) scale('+scale+')'; | |
map.css({ | |
'width' : (100/scale)+'%', | |
'-webkit-transform' : transform, | |
'-moz-transform' : transform, |
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
Module Module1 | |
Dim rnd As New Random() | |
Dim fmt1, fmt2, fmt3 As Int32 | |
Dim str1, str2, oprs(), opr, answer As String | |
Dim Playing As Boolean = True | |
Dim Display As Boolean = True | |
Sub Main() | |
While Display | |
DisplayMenu() | |
End While |
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
SELECT CustomerName, Address, Postcode | |
FROM Magazine, Subscription, Customer | |
WHERE MagazineName = ‘AQA Computing Now’ | |
AND EndDate < ‘01/06/2010’ | |
AND | |
Magazine.MagazineID = Subscription.MagazineID | |
AND | |
Subscription.CustomerID = Customer.CustomerID |
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
API.on(API.ADVANCE, function(json){ | |
var users = ["Minkle of Shenanigans"]; | |
for(var i = 0; i < users.length; i++) { | |
if( | |
( | |
( API.getDJ().username === users[i] ) && | |
( API.getWaitList().length < 1 ) | |
) || API.getDJ().username === undefined | |
) { | |
bot.settings.historySkip = false; |
NewerOlder