Python: Write the code

Beginner Python
Created by Best · 12.04.2026 at 16:05 UTC

Short coding tasks. Your answer is compared after normalizing whitespace and trailing semicolons.

University approvals: 0
Tasks
Question 1

Write a one-line expression that returns the sum of all elements in the list nums. Use the built-in sum.

(Type only the expression, e.g. sum(nums).)

Question 2

Given a non-empty list lst, write an expression that returns the last element. Use indexing.

(Type only the expression.)

Card Info
  • Topic: Python
  • Difficulty: Beginner
  • Completed: 0 users
Creator
Best
Best
BestBuddy