Skip to content

Instantly share code, notes, and snippets.

@Denkotleta221
Created December 15, 2024 14:42
Show Gist options
  • Save Denkotleta221/9c15d8740ecf276a46b86e22a2fdc197 to your computer and use it in GitHub Desktop.
Save Denkotleta221/9c15d8740ecf276a46b86e22a2fdc197 to your computer and use it in GitHub Desktop.
# 1) Task
# first_num = float(input("Enter first fraction number: "))
# second_num = float(input("Enter second fraction number: "))
# sum_int = int(first_num) + int(second_num)
# sum_fractiun = (first_num % 1) + (second_num % 1)
# print(sum_int)
# print(sum_fractiun)
# 2) Task
# cash = float(input("Enter the amount in hryvnia: "))
# hryvnia = int(cash)
# kopecks = int((cash % 1) * 100) + 1
# print(f"You have {hryvnia} vryvnia and {kopecks} kopecks")
# 3) Task
# tons = float(input("Enter the number of tons: "))
# ton = int(tons)
# kilogram = int((tons % 1) * 1000)
# gram = int((((tons % 1) * 1000) % 2) * 1000)
# print(f"{ton} tons {kilogram} kilograms {gram} gram")
# 4) Task
# seconds_time = int(input("Enter time in seconds: "))
# days = seconds_time // (24 * 60 * 60)
# remember_time = seconds_time % (24 * 60 * 60)
# hours = remember_time // (60 * 60)
# remember_time %= (60 * 60)
# minutes = remember_time // 60
# seconds = remember_time % 60
# print(f"{seconds_time} seconds = {days} day, {hours} hours, {minutes} minutes, {seconds} seconds")
# 5) Task
# gigabytes = float(input("How many gigabytes dose it take to download a movie: "))
# speed_internet = float(input("What is the inetrnet sped in Mg/s: "))
# m_byte = gigabytes * 1024
# seconds_downlad = int(m_byte / speed_internet)
# print(seconds_downlad)
# 6) Task
# num = float(input("Enter a non-intger number for examlpe : "))
# num *= 100
# num = int(num) / 100
# print(num)
# 7) Task
# hryvnia = float(input("How many hryvnias are deposit into the account: "))
# mounth = int(input("What is the deposit term in mounth: "))
# percent = int(input("At what percentage: "))
# sum_in_mounth = (hryvnia * percent) / 100
# your_money = sum_in_mounth * mounth
# print(f"Your income: { your_money}")
# 8) Task
# first_num = int(input("Enter first number: "))
# second_num = int(input("Enter second number: "))
# third_num = int(input("Enter third number: "))
# if first_num < second_num and first_num < third_num:
# print("The smallest number is: ", first_num)
# elif second_num < first_num and second_num < third_num:
# print("The smallest number is: ", second_num)
# elif third_num < third_num and second_num < third_num:
# print("The smallest number is: ", third_num)
# 9) Task
# num = int(input("Enter number(ineger): "))
# if num < 0:
# print("This is a negtive number.")
# elif num == 0:
# print("This is zero.")
# elif num > 0:
# print("This is a positive number.")
# 10) Task
# num = int(input("Enter any number: "))
# if num >= 1000:
# print("This is a four-didgit number.")
# elif num >= 100:
# print("This is a three-digit number.")
# elif num >= 10:
# print("This is a two-digit number.")
# else:
# print("This is single digit number")
# 11) Task
# left_corner = int(input("Enter the value of the upper left corner of the region: "))
# right_corner = int(input("Enter the value of the lower right corner of the region: "))
# while left_corner > right_corner:
# print("The coordinate value is incorect")
# print("Enter right coordinate ")
# left_corner = int(input("Enter the value of the upper left corner of the region: "))
# right_corner = int(input("Enter the value of the lower right corner of the region: "))
# x_axis = int(input("Enter the x-coordinate: "))
# y_axis = int(input("Enter the y-coordinate: "))
# if x_axis > left_corner and x_axis < right_corner :
# in_x = True
# else:
# in_x = False
# if y_axis > left_corner and y_axis < right_corner :
# in_y = True
# else:
# in_y = False
# if in_x and in_y:
# print("The point is located in the rectangle.")
# else:
# print("The point is not in the rectangle.")
# 12) Task
# 13) Task
# Option 1
# num_tiket = int(input("Enter number tikets: "))
# first_num = num_tiket / 1000
# second_num = int((first_num % 1) * 1000)
# first_num = str(int(first_num))
# first_num1 = first_num[0]
# first_num2 = first_num[1]
# first_num3 = first_num[2]
# second_num = str(second_num)
# second_num1 = 0
# second_num2 = 0
# second_num3 = 0
# if len(second_num) >= 1:
# second_num1 = second_num[0]
# if len(second_num) >= 2:
# second_num2 = second_num[1]
# if len(second_num) >= 3:
# second_num3 = second_num[2]
# sum_first = int(first_num1) + int(first_num2) + int(first_num3)
# sum_second = int(second_num1) + int(second_num2) + int(second_num3)
# if sum_first == sum_second:
# print("You winner")
# else:
# print("This is not winner tikets.")
# Option 2
# num_tiket = input("Enter number tikets:")
# num1 = int(num_tiket[0])
# num2 = int(num_tiket[1])
# num3 = int(num_tiket[2])
# num4 = int(num_tiket[3])
# num5 = int(num_tiket[4])
# num6 = int(num_tiket[5])
# if (num1 + num2 + num3) == (num4 + num5 + num6):
# print("You winner")
# else:
# print("This is not winner tikets.")
# 14) Task
# first_num = int(input("Enter first number: "))
# second_num = int(input("Enter second number: "))
# print("\n1.Addition\n2.Subtraction\n3.Multiplication\n4.Division\n5.Reminder from division")
# num = int(input("\nChose an option: "))
# match num:
# case 1:
# print(first_num + second_num)
# case 2:
# print(first_num - second_num)
# case 3:
# print(first_num * second_num)
# case 4:
# print(first_num / second_num)
# case 5:
# print(first_num % second_num)
# 15) Task
# print("\n1.Cow\n2.Sheep\n3.Rooster\n4.Woolf\n5.Snake")
# sound = input("\nChose an option: ")
# match sound:
# case 1:
# print("Muuuuuuuuu!")
# case 2:
# print("Beeeeeeeee!")
# case 3:
# print("Kykareru")
# case 4:
# print("RRRRRRRRRRRRRRRRRRR")
# case 5:
# print("Shshshshshshshshshsh")
# 16) Task
# num = int(input("Enter first number: "))
# print("Odd" if num % 2 != 0 else "Even")
# 17) Task
# num = int(input("Enter first number: "))
# print("In the range from 0 to 100" if num >= 0 and num <= 100 else "Not in teh range from 0 to 100")
# 18) Task
# num = int(input("Enter first number: "))
# print("The number is multiple 3, 5 ,7" if num % 3 == 0 and num % 5 == 0 and num % 7 == 0 else "The number is not a multiple")
# 19) Task
# num = input("Enter five-digit number: ")
# print("Polindrom number" if num == num[::-1] else "Not polindrom numbers")
# 20) Task
# num = float(input("Enter number: "))
# print("The number has no fraction pary" if num % 1 == 0 else "The number has a fraction part")
# 21) Task
# print("Welocom in Plphar-3000\n")
# print("Ask any question: \n")
# input("")
# import random
# num = random.randint(1, 7)
# match num:
# case 1:
# print("Yes")
# case 2:
# print("No")
# case 3:
# print("Maybe")
# case 4:
# print("More likely yes")
# case 5:
# print("More likely no")
# case 6:
# print("You'll be licky in this")
# case 7:
# print("You won't have nay luck with this")
# 21) Task
# start_con = input("Enter the beginning of the phone conversation in the format(12:43, 23:42, 01:13): ")
# finish_con = input("Enter the end of the phone conversation in the format(12:13, 11:12, 02:15): ")
# hours_start = int(start_con[0:2])
# minutes_start = int(start_con[-2:])
# hours_end = int(finish_con[0:2])
# minutes_end = int(finish_con[-2:])
# call_time_hours = hours_end - hours_start
# call_time_minutes = minutes_end - minutes_start
# if call_time_minutes < 0:
# call_time_hours -= 1
# call_time_minutes = abs(call_time_minutes)
# print(f"The telephone conversation laster {call_time_hours} hours and {call_time_minutes} minest")
# seonds_hours = call_time_hours * 3600
# seconds_minets = call_time_minutes * 60
# sum_seconds = seonds_hours + seconds_minets
# money_kopecks = sum_seconds * 15
# money_hryvnia = money_kopecks / 100
# money_kopecks = int((money_hryvnia % 1) * 100)
# money_hryvnia = int(money_hryvnia)
# print(f"Cost of a telephone call {money_hryvnia} hryvnia and {money_kopecks} kopecks")
# 22) Task
# date = input("Enter date (day.mounth.year(21.01.2021)): ")
# day = int(date[0:2])
# mounth = int(date[3:5])
# year = int(date[6:10])
# day += 1
# if day > 31:
# mounth += 1
# day = '01'
# if mounth >= 12:
# year += 1
# mounth = '01'
# print(f"Next day {day}.{mounth}.{year}")
# 23) Task
# print("Game 'First milion':\n")
# print("1. Question: ")
# print("How many blue stripes are there on the US flag?") # 13
# print("\n1. 6\n2. 7\n3. 13\n4. 0")
# ansver = int(input("Your ansver: "))
# bool_ansver = False
# match ansver:
# case 1:
# bool_ansver = False
# case 2:
# bool_ansver = False
# case 3:
# bool_ansver = True
# case 4:
# bool_ansver = False
# if bool_ansver:
# print("Yes this is corect ansver!")
# else:
# exit()
# print("\n2.Which planet is the hottest in the solar system?")
# print("\n1. Verna\n2. Mars\n3. Jupiter\n4. Mercury") # Mercury
# ansver = int(input("Your ansver: "))
# bool_ansver = False
# match ansver:
# case 1:
# bool_ansver = True
# case 2:
# bool_ansver = False
# case 3:
# bool_ansver = False
# case 4:
# bool_ansver = False
# if bool_ansver:
# print("Yes this is corect ansver!")
# else:
# exit()
# print("\n3. What is the rarest blood type?")
# print("\n1. I blood\n2. II bloob\n3. III blood\n4. IV boold") # IV boold
# ansver = int(input("Your ansver: "))
# bool_ansver = False
# match ansver:
# case 1:
# bool_ansver = False
# case 2:
# bool_ansver = False
# case 3:
# bool_ansver = False
# case 4:
# bool_ansver = True
# if bool_ansver:
# print("Yes this is corect ansver!")
# else:
# exit()
# print("\n4. How namy bones are there in the human body?")
# print("\n1. 206\n2. 205\n3. 201\n4. 209") # 206-208
# ansver = int(input("Your ansver: "))
# bool_ansver = False
# match ansver:
# case 1:
# bool_ansver = True
# case 2:
# bool_ansver = False
# case 3:
# bool_ansver = False
# case 4:
# bool_ansver = False
# if bool_ansver:
# print("Yes this is corect ansver!")
# else:
# exit()
# print("\n5. Which sicial network appearedin 2003?")
# print("\n1. Twich\n2. Twiter\n3. Facebook\n4. VK") # Facebook
# ansver = int(input("Your ansver: "))
# bool_ansver = False
# match ansver:
# case 1:
# bool_ansver = False
# case 2:
# bool_ansver = False
# case 3:
# bool_ansver = True
# case 4:
# bool_ansver = False
# if bool_ansver:
# print("\nCongratulation, you have become the winner of the show 'First Millon'!!!!!!!!!!!\n")
# else:
# exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment