
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is python .. ("dot dot") notation syntax?
There is no special .. ("dot dot") notation syntax in python. You can, however, see this in case of floats accessing their properties. For example,
f = 1..__truediv__ # or 1..__div__ for python 2 print(f(8))
This will give the output:
0.125
What we have is a float literal without the trailing zero, which we then access the __truediv__ method of. It's not an operator in itself; the first dot is part of the float value, and the second is the dot operator to access the object's properties and methods. This can also be achieved using:
>>> f = 1. >>> f 1.0 >>> f.__truediv__
- Related Questions & Answers
- Regular Expression "." (dot) Metacharacter in Java
- Dot notation in JavaScript
- Dot notation vs Bracket notation in JavaScript
- What is a dot operator in Python?
- Field selection within MongoDB query using dot notation?
- What is "is not" operator in Python?
- What is dot operator in Java?
- What is dot operator in C++?
- What is "not in" operator in Python?
- Safely setting object properties with dot notation strings in JavaScript
- What is difference in Python operators != and "is not"?
- What is "Argument-Dependent Lookup" ("Koenig Lookup") in C++?
- What is "function*" in JavaScript?
- What is the difference between "var" and "val" in Kotlin?
- What is the difference between "const" and "val" in Kotlin?
Advertisements