Merge pull request #3325 from danilaml/py3-ext

Add py3 to Python's extensions list
This commit is contained in:
Brandon Black
2016-11-13 17:57:56 -08:00
committed by GitHub
2 changed files with 21 additions and 0 deletions

View File

@@ -3377,6 +3377,7 @@ Python:
- ".fcgi" - ".fcgi"
- ".gyp" - ".gyp"
- ".lmi" - ".lmi"
- ".py3"
- ".pyde" - ".pyde"
- ".pyp" - ".pyp"
- ".pyt" - ".pyt"

20
samples/Python/py3.py3 Normal file
View File

@@ -0,0 +1,20 @@
import random
guesses = 0
number = random.randint(1, 20)
print("Guess the number between 1 and 20! You have 6 tries.")
while guesses < 6:
guess = int(input("Is it... "))
if guess == number:
print("Hooray! You guessed it right!")
break
elif guess < number:
print("It's bigger...")
elif guess > number:
print("It's not so big.")
guesses += 1
if guesses == 6:
print("You've ran out of tries.")