match..case statement in PYTHON The latest Python starting from Python 3.10, a match..case structure has been introduced as an alternative to switch..case in other languages. Syntax: match term : case pattern - 1 : action - 1 case pattern - 2 : action - 2 case pattern - 3 : action - 3 .... .... case pattern-n: action-n case _ : default-action statement - x If any pattern (pattern-1, pattern-2, pattern-3, ..., pattern-n) starting from pattern-1 is matched with the term, then the corresponding action will be performed, and after that, the statement following the match..case will execute. i.e., statement-x. If none of the patterns match, case ...
Swap two numbers using a logical operator It is possible to swap two numbers without using a temporary variable and it is possible XOR operator. The truth table of the XOR operator Program #include <stdio.h> int main() { int a,b; printf("Enter two numbers\n"); scanf("%d%d",&a,&b); printf("Before Sawp: a=%d.... b=%d",a,b); a=a^b; b=a^b; a=a^b; printf("\nAfter Swap: a=%d.... b=%d",a,b); return 0; } OUTPUT
Data Visualization It is an extremely important part of Data Analysis Top 8 Python Libraries for Data Visualization 1. Matplotlib 2. Plotly 3. Seaborn 4. GGPlot 5. Altair 6. Bokeh 7. Pygal 8. Geoplotlib
Comments
Post a Comment