Tips for python beginners to solve Codeforces Problems.

Revision en2, by SpS__79, 2025-10-30 13:21:24
  1. Map function — While taking an integer array input in python we can easily take it through the map function and using the code mentioned below we can directly change it into a list. var = list(map(int,input().split()))
  2. Max-Min function — To get the maximum or minimum value from a list. val = max(var)
  3. Sort — For sorting an array[Remember the sort() method doesn't return the sorted list. Rather it sorts the list in place and returns None. Therefore, assigning var.sort() in a variable will make a equal to None] var.sort() print(var)
  4. List Comprehension : You can directly perform loop inside a List. lis = [for i in range(10)]
  5. Array Output : For array output you can use two method. 1. print((" ").join(map(str,array))) or simply print(*array)

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English SpS__79 2026-03-15 16:26:18 1541
en2 English SpS__79 2025-10-30 13:21:24 130
en1 English SpS__79 2025-03-28 17:26:20 774 1.0 (published)