Csv directly from chatgpt
user_3824920
plain_text
11 days ago
1.5 kB
0
Indexable
Never
import pandas as pd # Create a DataFrame with the provided questions and answers data = { "Question_Text__c": [ "What is 2+2?", "What is the capital of France?", "What is the color of the sky?", "Who invented the telephone?", "What is the largest ocean?", "What is the speed of light?", "Who painted the Mona Lisa?", "What planet is known as the Red Planet?", "How many continents are there?", "What is the boiling point of water?" ], "Choice_1__c": [ "3", "London", "Red", "Edison", "Atlantic", "300 km/s", "Van Gogh", "Venus", "5", "50°C" ], "Choice_2__c": [ "4", "Paris", "Blue", "Bell", "Indian", "300,000 km/s", "Picasso", "Mars", "6", "100°C" ], "Choice_3__c": [ "5", "Rome", "Green", "Tesla", "Pacific", "150,000 km/s", "Da Vinci", "Jupiter", "7", "150°C" ], "Choice_4__c": [ "6", "Berlin", "Yellow", "Newton", "Arctic", "1,000 km/s", "Rembrandt", "Saturn", "8", "200°C" ], "Correct_Answer__c": [ "4", "Paris", "Blue", "Bell", "Pacific", "300,000 km/s", "Da Vinci", "Mars", "7", "100°C" ], "Marks__c": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] } # Convert the dictionary to a DataFrame df = pd.DataFrame(data) # Save the DataFrame to a CSV file csv_file_path = '/mnt/data/questions_and_answers.csv' df.to_csv(csv_file_path, index=False) csv_file_path
Leave a Comment