Quotes help make search much faster. Example: "Practice Makes Perfect"

Showing posts with label DataCamp. Show all posts
Showing posts with label DataCamp. Show all posts

Thursday, August 29, 2019

DataCamp Combining data types Sample Solution

# Update data types

year_1_str = str(year_1)

revenue_1_str = str(revenue_1)



# Create a complete sentence combining only the string data types

sentence = 'The revenue of ' + company_1 + ' in ' + year_1_str + ' was $' + revenue_1_str + ' billion.'



# Print sentence

print(sentence)

DataCamp Booleans in Python Sample Solution

# Test equality

test_company = 'apple'

print(company_1 == test_company)


# Compare revenue_1 and revenue_2

print(revenue_1 > revenue_2)

DataCamp Determining types Sample Solution

# Type of company_1

print(type(company_1))



# Type of year_1

print(type(year_1))



# Type of revenue_1

print(type(revenue_1))

DataCamp Creating variables Sample Solution

# Create company_1

company_1 = 'Apple'

print(company_1)


# Create year_1

year_1 = 2017

print(year_1)


# Create revenue_1

revenue_1 = 229.23

print(revenue_1)

This is an example of scrolling text using Javascript.

Popular Posts