Question
I need help please with this, i am very stuck on this and lost.. please explain it to me on how to finish it.. so
I need help please with this, i am very stuck on this and lost.. please explain it to me on how to finish it.. so far i have this
This is my code:
first_t = [] second_t = [] third_t = [] forth_t = [] x = 0 y = 0
intro = int(input("How many elements do you want in your table? "))
for i in range(intro): number = float(input("Enter a number: ")) first_t.append(number) for i in range(0, len(first_t), intro): second_t.append(int(first_t[i]*number)) print(second_t)
This gives the output as
It prints the multiplication but i cant figure a way to make it look like this..
Suspended O ] python3 hw3_part4.py How many elements do you want in your table? 3 Enter a number: 2 Enter a number: 3 Enter a number: 4 [4, 6, 8] Then ask the user for that many numbers (floats in general). Then create a multiplication table where you multiply x* y for each x and y in the list. Hint: you may have to use print(x * y, end="") to prevent newlines at some point. Also, print() will print a newline if you need one. linux [0] $ python3 hw3_part4.py How many elements do you want in your table? 3 Enter a number: 1.2 Enter a number: 5 Enter a number: 8.7 1.44 6.0 10.44 6.0 25.0 43.5 10.44 43.5 75.68999999999998 linux [0] $ python3 hw3_part4.py How many elements do you want in your table? 5 Enter a number: 3 Enter a number: 4 Enter a number: 5 Enter a number: 6 Enter a number: 7
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started