GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

What does each element within the view returned by my_dict.i…

What does each element within the view returned by my_dict.items() typically consist of?

Read Details

If users = {“u1”: “Alice”, “u2”: “Bob”}, what is returned by…

If users = {“u1”: “Alice”, “u2”: “Bob”}, what is returned by users.pop(“u1”)?

Read Details

What happens if you try to run sum(list(user_roles.values())…

What happens if you try to run sum(list(user_roles.values())) where user_roles = {“alice”: “admin”, “bob”: “editor”}?

Read Details

If sales_data = [{“day”: “Mon”, “amount”: 100}, {“day”: “Tue…

If sales_data = [{“day”: “Mon”, “amount”: 100}, {“day”: “Tue”, “amount”: 150}]. How would you sum the “amount” values using concepts covered? (Without loops).

Read Details

Which expression correctly checks if the key “port” exists i…

Which expression correctly checks if the key “port” exists in the dictionary settings?

Read Details

Start with d = {}. Then execute d[‘a’] = 1, d[‘b’] = 2, d[‘c…

Start with d = {}. Then execute d[‘a’] = 1, d[‘b’] = 2, d[‘c’] = 3, d.pop(‘b’). What is len(d)?

Read Details

Given keys = [‘a’, ‘b’, ‘c’] and values = [1, 2, 3], what do…

Given keys = [‘a’, ‘b’, ‘c’] and values = [1, 2, 3], what does {k: v for k, v in zip(keys, values)} produce?

Read Details

If data = {“item”: “Book”, “qty”: 5} and you execute data[“i…

If data = {“item”: “Book”, “qty”: 5} and you execute data[“item”] = “Magazine”, what best describes what happened?

Read Details

Although not explicitly detailed in the notes beyond basic u…

Although not explicitly detailed in the notes beyond basic unpacking, Python supports extended unpacking. If data = (1, 2, 3, 4, 5), what values are assigned in first, *middle, last = data?

Read Details

Given names = [“alice”, “bob”, “charlie”], what does [name.u…

Given names = [“alice”, “bob”, “charlie”], what does [name.upper() for name in names] produce?

Read Details

Posts pagination

Newer posts 1 … 27,197 27,198 27,199 27,200 27,201 … 85,133 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top