Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hello World!")
- # print(345657**356)
- # a = int(input("Number to * by 4 "))
- # b = 4
- # c = a * b
- # str = "{}*{} = {}".format(a, b, c)
- # # These lines do the same thing!
- # print(str)
- # print(a, "*", b, "=", c)
- # DO NOT REMOVE THIS LINE - I don't know why, but the program breaks if you do
- # n = 15
- # if n % 3 == 0:
- # print("Fizz\n")
- # if n % 5 == 0:
- # print("Buzz")
- # print()
- # print(n)
- def isMultipleOf3(n):
- return n % 3 == 0
- def isMultipleOf5(n):
- return n % 5 == 0
- def FizzBuzz(maxValue):
- for n in range(1, maxValue):
- if isMultipleOf3(n) and isMultipleOf5(n):
- print("FizzBuzz")
- elif isMultipleOf3(n):
- print("Fizz")
- elif isMultipleOf5(n):
- print("Buzz")
- else:
- print(n)
- print()
- # print(isMultipleOf3(3))
- # print(isMultipleOf3(5))
- # FizzBuzz(15)
- # FizzBuzz(26677)
- # x = input("Give me a number: ")
- # x = int(x)
- # FizzBuzz(x)
- listOfCourses = ["English", "Linguistics", "Computer Science"]
- print(listOfCourses)
- listOfCourses.append("Biology")
- print(len(listOfCourses))
- for course in listOfCourses:
- print("LU teaches", course)
- nums = [1, 2, 3, 4, 5]
- for n in nums:
- print(n *3)
- # numsTimes4 = [x for x in range(1, 15): x * 4]
- import random
- print(random.random())
- # I go to Washington
- # ["I", "go", "to", "Washington"]
- # Mr. Smith goes to Washington. I went last year...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement