# 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
-
Answer: Alt - p p stands for previous. If you keep pressing Alt - p, you will continue cycling back through commands you typed before. I...
-
favorite_animal ||= "dog" favorite_animal ||= "cat"
-
//sample solution def isEven(x): if(x % 2 == 0): return "yep" else: return "nope"
-
<!--sample solution--> <html> <head> <title>Week 13 Project</title> </head> ...
-
#sample solution hungry = false unless hungry puts "I'm writing Ruby programs!" else puts "Time to eat!...
-
<!-- Sample solution to index.html --> <!DOCTYPE html> <html> <body> <div class="nav"> ...
-
$("#tours > li")
-
<html> <head> <!-- Add the Parse SDK here! --> <script src="http://www.parsecdn.com/js/par...
-
//sample solution var yourName = "Pam"; var gender = "female"; var result; //Line 10 starts an if statement //Ne...
-
#sample solution count = 0 if count < 5: print "Hello, I am an if statement and count is", count while count ...