- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Pythonista has Published 42 Articles
Pythonista
38K+ Views
CSV (Comma Separated Values) is a most common file format that is widely supported by many platforms and applications.Use csv module from Python's standard library. Easiest way is to open a csv file in 'w' mode with the help of open() function and write key value pair in comma separated ... Read More
Pythonista
86 Views
You can't read user input in an un-initialized pointer. Instead, have a variable of the struct data type and assign its address to pointer before accessing its inner elements by → operatorexample#include struct example{ char name[20]; }; main(){ struct example *ptr; struct example e; puts("enter ... Read More
Pythonista
945 Views
Usin count() function in itertools module gives an iterator of evenly spaced values. The function takes two parameters. start is by default 0 and step is by default 1. Using defaults will generate infinite iterator. Use break to terminate loop.import itertools percentNumbers = [ ] finish = "n" num = ... Read More
Pythonista
230 Views
Python doesn't have an equivalent of do-while loop as in C/C++ or Java. The essence of do-while loop is that the looping condition is verified at the end of looping body. This feature can be emulated by following Python code −Examplecondition=True x=0 while condition==True: x=x+1 print ... Read More
Pythonista
3K+ Views
Python has magic methods to define overloaded behaviour of operators. The comparison operators (=, == and !=) can be overloaded by providing definition to __lt__, __le__, __gt__, __ge__, __eq__ and __ne__ magic methods. Following program overloads < and > operators to compare objects of distance class. class distance: def __init__(self, ... Read More
Pythonista
11K+ Views
Python has magic methods to define overloaded behaviour of operators. The comparison operators (=, == and !=) can be overloaded by providing definition to __lt__, __le__, __gt__, __ge__, __eq__ and __ne__ magic methods. Following program overloads == and >= operators to compare objects of distance class.class distance: def ... Read More
Pythonista
210 Views
while statement is very popular looping statement in many languages including Python. Is general usage is −while expr==True: stmt1 stmt2 .....The block of statements with increased indent after : symbol will be repeatedly executed as long as expr remains true. Obviously, certain provision must ... Read More