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

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!

Solution

# 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\")
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

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site