Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Cycle through and compare a list with a variable

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 584 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 10/03/2011 at 22:18, xxxxxxxx wrote:

      Hi folks,

      I am sorry to ask so many basic stuff here but but the examples in the c4d world are stil scarce and the original python sdk is not as understandable as i wished.

      I want to cycle through and compare a list with a variable like.

        
      #pseudocode do not copy ;-)   
      variabletestme = 1.78   
      alist = (1.23323, 2.23432424, 4.34535, 1.78)   
        
      if variabletestme == isin(alist) :   
          go for it
      

      any idea?

      thanks in advance

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 10/03/2011 at 23:28, xxxxxxxx wrote:

        It's the best explained one I've ever seen.
        Python 2.7 Doc - Tutorial

          
        v = 1.78  
        lst = (1.231, 846, 1.78, 96513)  
          
        if v in lst:  
          print "v is in lst"
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post