This commit is contained in:
lw-everestlinux committed 2022-12-13 11:38:55 -05:00
1 parent 19881139f2
commit 7a1383f13c
23 files changed
+94

No files matched your search

BIN
View File
Binary file not shown.
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/python3
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/python3
while True:
print("hi")
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2
View File
@@ -0,0 +1,2 @@
while True:
print("hi")
+2
View File
@@ -0,0 +1,2 @@
for i in range (11):
print(i, end=" ")
+3
View File
@@ -0,0 +1,3 @@
num = int(input("Enter a number: "))
print(str(num)[::-1])
+4
View File
@@ -0,0 +1,4 @@
n = int(input("Enter a number: "))
b = sum(range(1, n+1))
print(b)
+5
View File
@@ -0,0 +1,5 @@
a = int(input("Enter a number: "))
c = 1
while (c <= 10):
print(a * c)
c += 1
+7
View File
@@ -0,0 +1,7 @@
a = int(input("Enter a number: "))
b = a * 5
c = b % 2
if (c != 0):
print("Not divisible by 5")
else:
print("Divisible by 5")
+7
View File
@@ -0,0 +1,7 @@
a = int(input("Enter a number: "))
count = 0
while (a > 0):
count = count + 1
a = a // 10
print(count)
+2
View File
@@ -0,0 +1,2 @@
for i in range(-10,0):
print(i, end=" ")
+9
View File
@@ -0,0 +1,9 @@
tg = int(input("Enter a number: "))
for number in range(1,tg+1):
if number > 1:
for i in range(2, number):
if (number%i) == 0:
break
else:
print(number)
+11
View File
@@ -0,0 +1,11 @@
a = 100
n1, n2 = 0, 1
count = 0
while count < a:
print(n1)
nth = n1 + n2
n1 = n2
n2 = nth
count += 1
+5
View File
@@ -0,0 +1,5 @@
import math
a = int(input("Enter a number: "))
b = math.factorial(a)
print(b)
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/env python3
import random
import sys
print("(This story is based off of the video game series Risk of Rain)")
print("You are a soldier for a delivery company, dispatched to an unknown\n")
print("planet responding to a distress signal.\n")
print("\n")
print("Your escape pod barrels towards the planet, and you get out.\n")
print("\n")
print("You see a creature coming towards you, but are unsure if it is hostile.\n")
print("[ ? ] Do you leave it or attack it?\n"
print("( 1 ) Leave it\n")
print("( 2 ) Attack it\n")
a = int(input("==> "))
if a == "1":
print("It attacks you. With only a pistol to defend yourself, you manage to fend it off, but more come.\n")
print("You are unsure of their intentions, and they eventually overpower you. You die without a trace.\n")
print("GAME OVER\n")
sys.exit(0)
elif a == "2":
print("You attack the creature. It drops money, which looks like it can open locked chests from\n")
print("the crash of a previous cargo ship. You open one, and you find a pair of sunglasses inside\n")
print("The sunglasses appear to make the wearer more powerful.\n")
print("\n")
print("You find a strange stone altar in the landscape, and you activate it.\n")
print("After a brief flash of red light, a large stone figure appears.\n")
print("\n")
print("