This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
friends = ['Taylor', 'Alex', 'Pat', 'Eli'] | |
for friend in friends: | |
print("Hi " + friend) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in range(10): | |
print("Hello, World!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ratio = ((1+(5**(1/2)))/2) | |
print(ratio) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
disk_size = 16*1024*1024*1024 | |
sector_size = 512 | |
sector_amount = (((16*1024*1024*1024)/512)) | |
print(sector_amount) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bill = 47.28 | |
tip = 0.15 * bill | |
total = bill + tip | |
share = total/2 | |
print("Each person needs to pay: " + str (share)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numerator = 10 | |
denominator = 10 | |
result = numerator / denominator | |
print(result) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
word1 = "How" | |
word2 = "do" | |
word3 = "you" | |
word4 = "like" | |
word5 = "Python" | |
word6 = "so" | |
word7 = "far?" | |
print("How " +"do ""you ""like ""Python ""so ""far?") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_seconds(hours, minutes, seconds): | |
print(3600*hours+60*minutes+seconds) | |
print_seconds(1,2,3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_seconds(hours, minutes, seconds): | |
return 3600*hours + 60*minutes + seconds | |
amount_a = get_seconds(2,30,0) | |
amount_b = get_seconds(0,45,15) | |
result = amount_a + amount_b | |
print(result) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# REPLACE THIS STARTER CODE WITH YOUR FUNCTION | |
def month_days(month,days): | |
print(month + " has " + str(days) + " days.") | |
month_days("June","30") | |
month_days("July","31") |
OlderNewer