In the blank spaces below, write the output produced by each…
In the blank spaces below, write the output produced by each line of the following program, as it would appear on the console. def statement(mary, john, fun): print(john, “to”, fun, “and”, mary, “extra”) return fun * 2 def main(): john = 4 mary = 12 george = 23 fun = 13 work = 7 again = statement(mary, john, fun) mary = statement(george, work, john) statement(fun, again, 2) george = statement(george, mary, john) statement(george, 3, 1) main() Line 1: [l1] Line 2: [l2] Line 3: [l3] Line 4: [l4] Line 5: [l5]
Read DetailsIn the blank spaces below, write the output produced by each…
In the blank spaces below, write the output produced by each line of the following program, as it would appear on the console. def param(semi, c, brace): print(c, “missing a”, brace, “and”, semi) return semi – brace def main(): literal = 8 brace = 4 paren = 1 semi = 7 c = 42 paren = param(c, brace, semi) brace = param(literal, paren, c) param(brace, semi, 4) param(0, literal + 4, 1) main() Line 1: [l1] Line 2: [l2] Line 3: [l3] Line 4: [l4]
Read DetailsIn the blank spaces below, write the output produced by each…
In the blank spaces below, write the output produced by each line of the following program, as it would appear on the console. def slogan(one, four, two): print(four, “minus”, two, “is”, one) one = one + “1” return four def main(): four = “ten” one = “cat” twelve = “two” two = “dog” three = slogan(two, twelve, one) four = four + slogan(one, “twelve”, three) slogan(one, four, twelve) four = slogan(twelve + “2”, four, twelve) slogan(“one”, “mouse”, four) main() Line 1: [l1] Line 2: [l2] Line 3: [l3] Line 4: [l4] Line 5: [l5]
Read Details