Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does [, element] mean? [duplicate]

Tags:

python

I was reading the python documentation where I came across elem [,n] this notation for arguments. I have seen such notations in past. Don't just know what they mean. Also, google doesn't support searching brackets.

like image 324
MeetM Avatar asked Jul 19 '13 17:07

MeetM


People also ask

What are the duplicate elements?

Duplicate elements can be found using two loops. The outer loop will iterate through the array from 0 to length of the array. The outer loop will select an element. The inner loop will be used to compare the selected element with the rest of the elements of the array.

How do I get rid of duplicate elements?

We can remove duplicate element in an array by 2 ways: using temporary array or using separate index. To remove the duplicate element from array, the array must be in sorted order. If array is not sorted, you can sort it by calling Arrays. sort(arr) method.

What is duplicate elements in C?

In this program, we need to print the duplicate elements present in the array. This can be done through two loops. The first loop will select an element and the second loop will iteration through the array by comparing the selected element with other elements.

What is duplicate elements in Python?

In this article we will see a python program to find Duplicate elements in an array. Duplicates elements are those whose existence in array is more than once.


2 Answers

The Python documentation has a section about the used notation, which says:

[…] a phrase enclosed in square brackets ([ ]) means zero or one occurrences (in other words, the enclosed phrase is optional).

This notation originates from the Backus–Naur Form (BNF).

like image 55
Gumbo Avatar answered Oct 11 '22 13:10

Gumbo


It means that the argument so bracketed is optional.

like image 25
Marcin Avatar answered Oct 11 '22 13:10

Marcin