zharry

Exam Tedious Question

Jun 14th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.66 KB | None | 0 0
  1. import math
  2. import random
  3.  
  4. var = 55
  5. print(var)
  6.  
  7. def findTheOutput(inputString, inputList, inputTuple):
  8.     # Easy
  9.     var = "Test"
  10.     string1 = "\"\\\"\n\"\\\""
  11.     int1 = int(math.pow(3, 2) // 2 ** 2)
  12.     float1 = 7E-2
  13.     string2 = str(float1) + str(int(float1))
  14.     string3 = string2
  15.     string3 *= int1
  16.     output = """{}
  17. {}
  18. {}
  19. {}
  20. """.format(string1, string3, string1, var)
  21.     a, b, c = inputTuple
  22.     print(a * int(c) + b)
  23.    
  24.     # Hard
  25.     output += "The current length of the variable inputString is " + str(len(inputString))
  26.     inputString = inputString[-10:12:2][::-1] + "ecabd"[2]
  27.     output += "\n{:*^20s}\n".format(inputString)
  28.     for c in inputString:
  29.         if c != "*":
  30.             output += c.upper()
  31.     output = output + "\n"
  32.     if not(not(True or False) or True == True and output > inputString or True < False):
  33.         output += str(bool(True -1))
  34.     if str(0.0) in string3 and "i".upper() in inputList[4]:
  35.         output += str(bool(False +1))
  36.     inputList[1] = int(str(inputList[1])[::-1]) # 69
  37.     inputList[4].remove("t")
  38.     inputList[4].extend(["S", "T"])
  39.     inputList.pop(2)
  40.     inputList[3] *= inputList[0].count("i") + (inputList.index(0) - 2)
  41.     inputList = inputList + ["Te", "st"]
  42.     inputList.pop(0)
  43.     inputList[1] = not inputList[1]
  44.     print(inputList)
  45.    
  46.     # Ah finally done!
  47.     return output
  48.  
  49. def main():
  50.     toOutput = "A random string"
  51.     toOutList = ["StringThing", 96, 6E9, False, ["L", "I", "s", "t"]]
  52.     toOutTuple = ("One", "Two", "3")
  53.     print(toOutList)
  54.     print(findTheOutput(toOutput, toOutList, toOutTuple))
  55.     print(toOutput)
  56.     print(toOutList)
  57.  
  58. main()
  59. print(var)
Add Comment
Please, Sign In to add comment