if 7 > 4:
print("The 7 is power than 4")
Run to view results
Run to view results
s = list("Hi there Sam!")
print(s)
Run to view results
s = "Hi there Sam!"
s.split()
Run to view results
planet = "Earth"
diameter = 12742
Run to view results
print(f"The diameter of {planet} is {diameter} Kilometers")
Run to view results
Run to view results
lista = [1,2.3,4,[1,2,3],8,[12,34,[45,67,"hello"],54,32,[23,23,[45,56,[56]]]]]
Run to view results
lista[5][2][2]
Run to view results
d = {'k1':
[1,2,3,
{'tricky':
['oh','man','inception',
{'target':[1,2,3,'hello']
}
]
}
]
}
Run to view results
d['k1'][3]['tricky'][3]['target'][3]
Run to view results
the list can change the tuple cant change the values
Run to view results
email = "alexander@domain.com"
email.split('@')[-1]
Run to view results
text = 'In my house there is not a dog only one cat'
if 'dog' in text.lower().split():
print('The word dog is in the text')
else:
print('Ther is no word dog in the text')
Run to view results
input_text = "In my house there is not a dog only one cat and I will adopte a DOG in the future"
input_text_lower = input_text.lower()
counter = input_text_lower.count("dog")
print(f"the word 'dog' apperars {counter} times.")
Run to view results
input_text = "In my house there is not a dog only one cat and I will adopte a DOG in the future"
input_text_lower = input_text.lower()
counter = 0
input_words = input_text_lower.split()
for word in input_words:
if word == "dog":
counter += 1
print(f"The word 'dog' apperar {counter} times.")
Run to view results
def caught_speeding(speed, is_birthday):
pass
Run to view results
caught_speeding(81,True)
Run to view results
caught_speeding(81,False)
Run to view results
def my_ticket(speed, my_brithday):
if my_brithday:
speed -= 5
if speed <= 60:
return "No ticket"
elif 61 <= speed <=80:
return "small ticket"
else:
return "Big ticket"
Run to view results