In Python, how can you execute a block of code multiple times without using a loop?
- List Comprehension
- Recursion
- exec() function
- goto statement
In Python, you can execute a block of code multiple times without using a loop by using recursion, where a function calls itself. This allows for repeated execution without an explicit loop construct.
Loading...
Related Quiz
- How would you optimize the performance of a deep learning model in TensorFlow or PyTorch during the inference stage?
- When integrating a Python back-end with a front-end form, how can you secure the application against Cross-Site Request Forgery (CSRF) attacks?
- You've imported a module using the import keyword but later realized that you want to reload it to reflect the changes. What would be the best approach?
- You are assigned to develop a machine learning model that can identify fraudulent transactions. How would you deal with the class imbalance in the dataset?
- Which of the following sorting algorithms is most efficient for small-sized data sets?