Skip to content

Instantly share code, notes, and snippets.

View techyrick009's full-sized avatar

moulik techyrick009

View GitHub Profile
answer = 7
print("Please guess a number between 1 to 10:")
guess = int(input())
if guess < answer:
print("Enter a higher value")
guess = int(input())
if guess == answer:
print("you have got on the first time")
print(B'techyrick.tech dude \xE2\x9C\x85'.decode("utf-8"))
list_1 = [1, 2, 1, 4, 6, 5, 7, 9]
print(list(set(list_1)))
count = 0
my_string = "Programiz"
my_char = "r"
for i in my_string:
if i == my_char:
count += 1
print(count)
import time
def countdown(time_sec):
while time_sec:
mins, secs = divmod(time_sec, 60)
timeformat = '{:02d}:{:02d}'.format(mins, secs)
print(timeformat, end='\r')
time.sleep(1)
time_sec -= 1
def get_permutation(string, i=0):
if i == len(string):
print("".join(string))
for j in range(i, len(string)):
words = [c for c in string]
# swap
my_string = "Always Techyrick"
cap_string = my_string.capitalize()
print(cap_string)
str1 = "follow"
str2 = "r"
# convert both the strings into lowercase
str1 = str1.lower()
str2 = str2.lower()
# check if length is same
if(len(str1) == len(str2)):
num = 34526666666666666666666666666
count = 0
while num != 0:
num //= 10
count += 1
print("Number of digits: " + str(count))
base = 36
exponent = 55
result = 1
while exponent != 0:
result *= base
exponent-=1
print("Answer = " + str(result))