New course! Every coder should learn Generative AI!
Try a free lesson+ 4
n = int(input())
[[print(*(i, "*", j, "=", i * j) if j < 11 else "---------------------") for j in range(12)] for i in range(n+1)]
Best I could do...still looking into it though.
+ 6
I think, most of the Parterre u already know.
print("a", 0* "b") -->a
print("a", 1* "b") -->ab
print("a", True* "b") -->ab
print("a", False* "b") -->a
print("a", (3==3)* "b") -->ab
print("a", (3==4)* "b") -->a
print("a", (3==3)* "-------") -->a-------
print("a", (3==3)* "/n-------") -->
a
-------
it is almost same Think as rodwynnejones did.
so if i==10 the block is finished and you add the line.
+ 3
ok...now the "----------" outputs correctly:-
n = int(input())
[[print(("{} * {} = {}".format(i, j, i * j)) if j < 11 else "--------------") for j in range(12)] for i in range(n+1)]
+ 1
@𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥
Some sort of list comprehension?
Maybe someone else can clarify.