Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Python 3 3. You are given the the data dictionary below. Notice that the gap data are stored as strings. Fix data by replacing

image text in transcribed

Using Python 3

3. You are given the the data dictionary below. Notice that the gap data are stored as strings. Fix data by replacing the strings with the appropriate floats and then print the dict. You might try using a loop or a list comprehension. Edit Attachments data = {'year':[1990, 2009, 2010], 'gdp':['8.95', '12.56', '14.78']} for i in enumerate(data): data['gdp'] = float('gdp') print(data) ValueError Traceback (most recent call last) in 1 data = {'year':[1990, 2000, 2010], 'gdp':['8.95', '12.56', '14.78']} 2 for i in enumerate (data): 3 data['gdp'] = float('gdp') 4 print(data) ValueError: could not convert string to float: 'gdp

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions

Question

Excel Comprehensive Capstone 2 Summer Revenue ( PC and Mac )

Answered: 1 week ago

Question

Write a Python program to check an input number is prime or not.

Answered: 1 week ago

Question

Understanding Group Leadership Culture and Group Leadership

Answered: 1 week ago