Posts

Showing posts with the label Python Interview question and solution

Python programming basic

   https://cccabs-service.in/blogs/python-ascending-order-and-decending-of-list-items Welcome to Python Programming Tutorial! Python is a high-level, interpreted, and general-purpose programming language. It was first released in 1991 by Guido van Rossum and has since become one of the most popular programming languages in the world. It is widely used for web development, data analysis, artificial intelligence, and scientific computing. In this tutorial, we will cover the basics of Python programming, including data types, control structures, functions, modules, and more. So, let's get started! Getting Started Before we begin, you need to install Python on your computer. You can download the latest version of Python from the official website: https://www.python.org/downloads/ Once you have installed Python, you can open the Python shell by typing "python" in your terminal or command prompt. This will open up a prompt where you can start typing Python code. Data Types Pyth...

Create a CSV file using JSON in Python

Image

Generator function in python programming

Image

Python Programming tutorial and exercise

Image
Python Programming to create a csv file json file example Create a CSV file using a JSON file in python programming # python programming for creating csv from json file # python programming tutorial import json import csv # reading json file using json library in python # converting json into python dictionary # extracting keys from python dictionary with open('student_info.json') as file: data = json.load(file) li = list(data[0].keys()) # creating csv file in python programming # creating csv file in file append mode # writing python list or dictionary into csv file using csv library with open('students.csv', 'a+', newline="") as cfile: writer = csv.writer(cfile) writer.writerow(li) for item in data: row = [item['id'], item['name']] writer.writerow(row) # example of json file [ { "id": 1, "name": "std1" }, { "id": 2, ...