What is the output of print({i: i * i for i in range(3)})?
- {0: 0, 1: 1, 2: 16}
- {0: 0, 1: 1, 2: 2}
- {0: 0, 1: 1, 2: 4}
- {0: 0, 1: 1, 2: 8}
The output is a dictionary comprehension where each key-value pair is the square of the corresponding value from the range(3). Therefore, the correct output is {0: 0, 1: 1, 2: 4}.
Loading...
Related Quiz
- In a project involving customer feedback analysis, which preprocessing step would you prioritize to handle various slangs and abbreviations in the feedback texts?
- ________ in ETL helps in reducing the load on the operational systems during data extraction.
- To combine changes from one branch to another in Git, the command used is 'git _______'.
- You are analyzing a dataset in Pandas with missing values. Which method would you use to impute these missing values based on other columns?
- In a real-time stock trading application, what algorithm would you use to ensure that you always get the best or optimal solution for stock price analysis?