Skip to content

nasser-2030/Py-Datatypes-Task

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

Py-Datatypes-Task

Tasks:

Conisder the following list: list = [2, 0, 1, 0] According to the question, write down the code or the output

Notes: These are not sequential, the code is only affecting the original list. Answers should only be 1 line long

  1. Output: 4
  • Code: print(len(list))
  1. Output: 2
  • Code: print(list[0])
  1. Output: 2
  • Code: print(list.count(0))
  1. Output: list index out of range
  • Code: print(list[4])
  1. Output: True
  • Code: 2 in list
  1. Output: [2, 0, 1, 0, 'A']
  • Code: list.append("A") print(list)
  1. Output: [0, 0, 1, 2]
  • Code: list.sort() print(list)
  1. Output: [2, 0, 1]
  • Code: list.pop() print(list)
  1. Output: [0, 1]
  • Code: print(list[1:3])
  1. Output: [0, 1, 0, 2]
  • Code: list.reverse() print(list)

Submission:

  • Modify this file to complete the tasks then create a pull request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published