+ 1

Tuple elements LEN

random=(1, “Dijon”, 13.4) len(random) Is this code supposed to show how many elements this tuple contains? I’m expecting a 3 to show but instead it shows nothing, why?

16th Jan 2023, 10:29 PM
MG Adnama
4 Réponses
+ 5
len(random) does return 3, but you're not displaying it to the screen. Change it to print(len(random))
16th Jan 2023, 10:45 PM
XXX
XXX - avatar
+ 2
MG Adnama you're overthinking things lol
24th Feb 2023, 10:21 AM
Oladimeji Emmanuel
Oladimeji Emmanuel - avatar
+ 1
Omg, im so stupiddd, ur right
16th Jan 2023, 10:45 PM
MG Adnama
0
MG Adnama Programming is nothing but stupidity, my friend.
24th Feb 2023, 2:00 AM
Arb Rahim Badsa
Arb Rahim Badsa - avatar