How do you do for loops in python and r?



How do you do for loops in python and r?..

Answer / Shivendra Pratap Singh

In Python, a basic for loop is created using the for keyword followed by an iterable object (e.g., list or range) and an indented code block:nnfor i in range(10):n print('Loop Iteration:', i)nnIn R, for loops are created using a similar syntax with the for() function:nnfor (i in 1:10) {n cat('Loop Iteration:', i, 'n')n}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Science Interview Questions

Which database is best for data science?

1 Answers  


How would you do market basket analysis in r and python?

1 Answers  


Do gradient descent methods always converge to the same point?

1 Answers  


Can you define data discretization?

1 Answers  


What are an eigenvalue and eigenvector?

1 Answers  


Can you compare the validation set with the test set?

1 Answers  


What is market basket analysis? How would you do it in r and python?

1 Answers  


What is market basket analysis?

1 Answers  


Explain supervised learning?

1 Answers  


How much ram do I need for data science?

1 Answers  


Is jupyter open source?

1 Answers  


What does sas stand out to be the best over other data analytics tools?

1 Answers  


Categories
  • AI Algorithms Interview Questions AI Algorithms (74)
  • AI Natural Language Processing Interview Questions AI Natural Language Processing (96)
  • AI Knowledge Representation Reasoning Interview Questions AI Knowledge Representation Reasoning (12)
  • AI Robotics Interview Questions AI Robotics (183)
  • AI Computer Vision Interview Questions AI Computer Vision (13)
  • AI Neural Networks Interview Questions AI Neural Networks (66)
  • AI Fuzzy Logic Interview Questions AI Fuzzy Logic (31)
  • AI Games Interview Questions AI Games (8)
  • AI Languages Interview Questions AI Languages (141)
  • AI Tools Interview Questions AI Tools (11)
  • AI Machine Learning Interview Questions AI Machine Learning (659)
  • Data Science Interview Questions Data Science (671)
  • Data Mining Interview Questions Data Mining (120)
  • AI Deep Learning Interview Questions AI Deep Learning (111)
  • Generative AI Interview Questions Generative AI (153)
  • AI Frameworks Libraries Interview Questions AI Frameworks Libraries (197)
  • AI Ethics Safety Interview Questions AI Ethics Safety (100)
  • AI Applications Interview Questions AI Applications (427)
  • AI General Interview Questions AI General (197)
  • AI AllOther Interview Questions AI AllOther (6)