This file contains 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
import datetime | |
name = str(input("Please Enter your Name:")) | |
age = int(input("Please Enter your Age:")) | |
numTimes = int(input("Number of times you want this message to be printed?")) | |
print(name.isalpha()) | |
currentYear = datetime.date.today().year | |
remainderAgefor100 = 100-age | |
futureYear = currentYear + remainderAgefor100 |
This file contains 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
list1 = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] | |
len = list1.__len__() | |
list2 = [] | |
for i,j in enumerate(list1): | |
if list1[i] < 5: | |
list2.append(j) | |
print("List with less than 5 is\n", list2) |