Hello, I'm a student studying Python.
The problem that needs to be solved is, when there are two lists, return the elements in those two lists multiplied by each other.
For example, if a = [1,2], b = [3,4], return 3,4,6,8.
At first, I tried to do fori, jin zip(a,b), and then the elements were circulated one by one, so I could only print three or eight.
I'd really appreciate it if you could tell me how to do it!
python
a = [1,2]
b = [3,4]
x_result = []
for anum in a:
for bnum in b:
x_result.append(anum * bnum)
print(x_result)
856 Uncaught (inpromise) Error on Electron: An object could not be cloned
776 M2 Mac fails to install rbenv install 3.1.3 due to errors
771 GDB gets version error when attempting to debug with the Presense SDK (IDE)
1235 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2025 OneMinuteCode. All rights reserved.