# 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)
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 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)
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))
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)
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)
Subscribe to:
Posts (Atom)
This is an example of scrolling text using Javascript.
Popular Posts
-
//Sample Solution const gameState = {} function preload() { this.load.image('codey', 'https://s3.amazonaws.com/codecademy-...
-
//sample solution function guessNumber(number, clue) { // Prompt the user for a number using the string value of clue guess = promp...
-
//sample solution //Here is the original card object var card1 = {"suit":"clubs", "rank": 8}; //Create a...
-
#sample solution def colorful_conditions(): color = "blue" if color == "red": return "firs...
-
function checkAnswerWrongPlace(ans, realanswer){ // This method compares two input strings representing a player's guess ("an...
-
Instruction: Find the id of the flights whose distance is below average for their carrier. Sample Solution: SELECT id FROM flights AS f...
-
# note: The instructions state to use "text.txt" but an error comes up stating that the file does not exist # as a work around, ...
-
# Sample Solution # Import packages import numpy as np import pandas as pd # Read in transactions data transactions = pd.read_csv(...
-
# Sample Solution from song_data import songs import numpy as np q1 = np.quantile(songs, 0.25) #Create the variables q3 and interquarti...
-
/*sample solution for style.css*/ body > p { background: green; } p { background: yellow; }