Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Type function does not work
#1
l=["Red", "Blue","Green","Orange","Violet"]

for c in l:
    print(c)

type(l)
In this code type function does not showing the answer. Why so?
Reply
#2
you have to wrap in print unless your in the python interpreter
print(type(l))
Reply
#3
(Mar-15-2019, 10:44 AM)metulburr Wrote: you have to wrap in print unless your in the python interpreter
print(type(l))

Thanks !

Sir, C will be a variable when using in for loop
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Why does unpickling only work ouside of a function? pjfarley3 5 457 Dec-24-2020, 08:31 AM
Last Post: pjfarley3
  tmdbsimple content type? How to work with it? pythonnewbie138 1 361 Aug-01-2020, 08:18 PM
Last Post: bowlofred
  len() function, numbers doesn't work with Geany Editor Penguin827 3 721 May-08-2020, 04:08 AM
Last Post: buran
  Creating function inside classes using type wolfmansbrother 3 621 Mar-20-2020, 01:21 AM
Last Post: wolfmansbrother
  Powerset function alternative does not work oClaerbout 1 531 Feb-11-2020, 11:34 AM
Last Post: Larz60+
  why my function doesn't work cimerio 4 859 Jan-20-2020, 08:11 PM
Last Post: cimerio
  Type hinting - return type based on parameter micseydel 2 667 Jan-14-2020, 01:20 AM
Last Post: micseydel
  Doesn't work function pyautogui.typewrite() aliyevmiras 1 1,328 Dec-22-2019, 11:35 AM
Last Post: aliyevmiras
  Getting type from input() function in Python 3.0 leodavinci1990 7 1,245 Jul-29-2019, 08:28 PM
Last Post: avorane
  Should a function ever be more permissive than its type hints? Shay 1 597 Mar-13-2019, 05:36 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020