- 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
V Jyothi has Published 87 Articles
V Jyothi
488 Views
You can format a floating number to a fixed width in Python using the format function on the string. examplenums = [0.555555555555, 1, 12.0542184, 5589.6654753] for x in nums: print("{:10.4f}".format(x))OutputThis will give the output −0.5556 1.0000 12.0542 5589.6655ExampleUsing the same function, you can also format integers −nums = [5, 20, ... Read More
V Jyothi
492 Views
The most straightforward way seems to use an external iterator to keep track. Note that this answer considers that you're looping on same sized lists. examplea = [10, 12, 14, 16, 18] b = [10, 8, 6, 4, 2] for i in range(len(a)): print(a[i] + b[i])OutputThis will give the ... Read More
V Jyothi
547 Views
Use the tag in HTML to create a heading. The HTML tag is used for specifying a header cell or table header within a table.The following are the attributes −AttributeValueDescriptionabbrabbreviated_textDeprecated − Specifies an abbreviated version of the content in a header cell.alignrightleftcenterjustifycharDeprecated − Content alignment in header cell.axisNameDeprecated ... Read More
V Jyothi
720 Views
With the help of following MySQL query, we can apply EXTRACT() function with WHERE clause on the dates stored in a table.mysql> Select StudentName,EXTRACT(Year from dateofreg)AS YEAR from testing WHERE StudentName = 'Gaurav'; +-------------+------+ | StudentName | YEAR | +-------------+------+ | Gaurav | 2017 | +-------------+------+ 1 row in set (0.00 sec)
V Jyothi
188 Views
Java lang package provides a Double class which has methods to convert Double to String and vice versa. You can convert a String to a double using the parseDouble() method and double to String using the toString() methodExampleLive Demopublic class StringDouble { public static void main(String args[]){ Double ... Read More
V Jyothi
4K+ Views
The split(String regex) method of the String class splits this string around matches of the given regular expression.This method works in the same way as invoking the method i.e split(String regex, int limit) with the given expression and a limit argument of zero. Therefore, trailing empty strings are not included ... Read More
V Jyothi
424 Views
We can verify whether the given string is empty using the isEmpty() method of the String class. This method returns true only if length() is 0.ExampleLive Demoimport java.lang.*; public class StringDemo { public static void main(String[] args) { String str = "tutorialspoint"; // ... Read More
V Jyothi
79 Views
You can compare two strings using == operator. But, it compares references of the given variables, not values.ExampleLive Demopublic class Sample { public static void main(String args[]){ String str1 = "hello"; String str2 = "hello"; System.out.println(str1 == str2); } }Outputtrue
To Continue Learning Please Login
Login with Google