Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please code in PYTHON Write while loop if needed not for loop! Write a code in P

ID: 3784653 • Letter: P

Question

Please code in PYTHON Write while loop if needed not for loop!

Write a code in Python you're given a list [1, 2, 3] return a new 2D list [[1], [2, 2], [3, 3, 3]]. Write a while loop if needed!

Explanation / Answer

# This sets the condition of x for later use x=0 # This is the main part of the program def numtest(): print ("I am the multiplication machine") print ("I can do amazing things!") c = input ("Give me a number, a really big number!") c=float(c) print ("The number", int(c), "multiplied by itself equals",(int(c*c))) print("I am Python 3. I am really cool at maths!") if (c*c)>10000: print ("Wow, you really did give me a big number!") else: print ("The number you gave me was a bit small though. I like bigger stuff than that!") # This is the part of the program that causes it to run over and over again. while x==0: numtest() again=input("Run again? y/n >>>") if x=="y": print("") numtest() else: print("Goodbye")