Skip to content

Commit 097f9a3

Browse files
committed
Update
1 parent 7e12801 commit 097f9a3

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def longest_word(text):
2+
word = text.split()
3+
longestWord = "0"
4+
if len(word):
5+
for i in word:
6+
if len(i) > len(longestWord):
7+
longestWord = i
8+
else:
9+
longestWord = None
10+
11+
return longestWord
12+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Provide a script printing every possible pairs of two letters,
2+
# only lower case, one by line, ordered alphabetically.
3+
4+
import string
5+
6+
# Print Every Possible letter pairs
7+
def printLetterPairs():
8+
letters = string.ascii_lowercase
9+
10+
for i in letters:
11+
for b in letters:
12+
print(i + b)
13+
14+
def printDistinctPairs():
15+
lowerCase_letter = string.ascii_lowercase
16+
for i in lowerCase_letter:
17+
for b in lowerCase_letter:
18+
if i != b:
19+
print(i + b)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Write functions to convert from Fahrenheit to Celsius and vice-versa.
2+
3+
from time import process_time_ns
4+
5+
6+
def fahrenheit_to_celsius(temp):
7+
F = temp
8+
C = (F - 32) * 5 / 9
9+
return C
10+
11+
def celsius_to_fahrenheit(temp):
12+
C = temp
13+
F = (C * 9/5) + 32
14+
return F
15+
16+
print(fahrenheit_to_celsius(98.6))
17+
print(celsius_to_fahrenheit(26))

0 commit comments

Comments
 (0)