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
#!/bin/python3 | |
from random import randint | |
player = input('rock (r), paper (p), scissors (s)') | |
print(player, 'vs', end=' ') | |
chosen = randint(1,3) | |
#print(chosen) |
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
#Tip calculator | |
bill = raw_input("Enter bill amount:\n");tip = raw_input("Enter tip percentage:\n") | |
total = int(bill) * float(tip) + int(bill) | |
print("Your bill total will be, " + str(total) + " dollars.") |
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
""" | |
Python program that prints out list elements less than a certain number | |
Hank Greenburg | |
Date: 6/28/2018 | |
""" | |
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] | |
for element in a: | |
if element <= 5: | |
print(element) | |
#Above is my program and below is the exact solution. |
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
""" | |
Python program that tells me if a number is odd or even | |
Hank Greenburg | |
Date: 6/28/2018 | |
""" | |
num = input("Pick a number, any number:\n") | |
if num % 2 == 0: | |
print("Your number is even.") | |
else: | |
print("Your number is odd.") |
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
""" | |
Python program | |
Hank Greenburg | |
Purpose: Create a program that asks the user to enter their name and their age. | |
Print out a message addressed to them that tells them | |
the year that they will turn 100 years old. | |
date: 6/28/2018 | |
""" | |
#To Do list: | |
#User input of age[*] |