Skip to content

Instantly share code, notes, and snippets.

View nmounzih's full-sized avatar

Nadia Mounzih nmounzih

View GitHub Profile
@nmounzih
nmounzih / guessing_game.py
Last active February 22, 2017 15:08
Guessing game
import random
count = 1
turns = []
comp_num = random.randint(1, 101)
while True:
user_guess = int(input("I'm thinking of a number between 1 and 100.\
What is your guess? "))
@nmounzih
nmounzih / HW #2 advanced
Created February 21, 2017 22:09
Guessing Game (advanced)
import random
count = 1
low_guess = []
high_guess = []
comp_num = random.randrange(1, 101)
while True:
user_guess = int(input("I'm thinking of a number between 1 and 100.\
@nmounzih
nmounzih / HW #2 normal
Created February 21, 2017 22:08
Guessing game (normal)
import random
count = 1
turns = []
comp_num = random.randint(1, 101)
while True:
user_guess = int(input("I'm thinking of a number between 1 and 100.\
What is your guess? "))
@nmounzih
nmounzih / HW #1 advanced
Created February 20, 2017 23:22
02/20 homework (advanced)
count = 0
num_sum = 0
strings = ""
while True:
if count == 0:
try:
user_input = input("Please choose a number: ")
if user_input == "":
break
@nmounzih
nmounzih / HW# 1 normal
Created February 20, 2017 21:53
02/20 homework (normal)
count = 0
num_sum = 0
while True:
try:
user_input = input("Please choose a number: ")
if user_input == "":
break
user_input = float(user_input)
count += 1
num_sum += user_input