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
''' | |
Take a list, say for example this one: | |
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] | |
and write a program that prints out all the elements of the list | |
that are less than 5. | |
Extras: |
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
''' | |
Ask the user for a number. Depending on whether the number is even or odd, print | |
out an appropriate message to the user. Hint: how does an even/odd number react | |
differently when divided by 2? | |
Extras: | |
If the number is a multiple of 4, print out a different message. | |
Ask the user for two numbers: one number to check (call it num) and | |
one number to divide by (check). If check divides evenly into num, tell |
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
''' | |
Create a program that asks the user to enter their name and their age. | |
Print out the message addressed to them that tells them the year they | |
will turn 100 years old. | |
''' | |
from datetime import datetime | |
today = datetime.now() |