Sie sind auf Seite 1von 3

hour = int(input("Starting time (hours): "))

mins = int(input("Starting time (minutes): "))


dura = int(input("Event duration (minutes): "))
duration_hour = dura // 60
total_hours = hour + duration_hour
duration_mins = dura % 60
total_mins = mins + duration_mins
total_mins2 = total_mins % 60
total_hours2 = total_hours + (total_mins // 60)
total_hours3 = total_hours2 % 24
print("Event ends at :", total_hours3,":",total_mins2)

income = float(input("Enter the annual income: "))


if income < 85528:
tax = (income * 0.18) - 556.2
if tax < 0:
tax = 0.0
else:
tax = 14839.2 + ((income - 85528)*0.32)
tax = round(tax, 0)
print("The tax is:", tax, "thalers")

year = int(input("Enter a year: "))


if year % 4 != 0:
print ("Common Year")
elif year % 100 != 0:
print ("Leap Year")
elif year % 400 != 0:
print ("Common Year")
else:
print ("Leap Year")

secret_number = 777
print("""+===================================================== +
| Welcome to my game, muggle! Enter an integer number |
| and guess what number I've picked for you. |
| So, what is the secret number? |
+===================================================== +""")
number = int(input())
while secret_number != number:
print ("Ha ha! You are stuck in my loop, Try again")
number = int(input())

print ("Well done, muggle! You are free now")

import time

for i in range (1, 6):


print (i, " Mississippi")
time.sleep(1)

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

counter = 1
secret_word = "chupacabra"
word = input ("Guess the secret word:")
while word != secret_word:
input ("Yor guess is wrong, Try again :")
if word == "chupacabra":
break
counter += 1
print ("You guessed the word in",counter,"attempts", " \n Now you have successfully left the loop")

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
user_word = input("Enter the word :")
user_word = user_word.upper()
for letter in user_word:
if letter == "A":
continue
elif letter == "E":
continue
elif letter == "I":
continue
elif letter == "O":
continue
elif letter == "U":
continue
else:
word_without_vowels = letter
print(word_without_vowels,"\n")

blocks = int(input("Enter the number of blocks: "))


counter = 1
height = 0
block = 0
while block < blocks:
block = block + counter
counter += 1
if (box > blocks):
break
height += 1
print("The height of the pyramid:", height)

steps = 0
c0 = int(input("Enter non-negative and non-zero integer number :"))
while c0 != 1:
if c0 % 2 == 0:
c0 = c0 / 2
print(int(c0))
steps = steps + 1
else:
c0 = 3 * c0 + 1
print(int(c0))
steps = steps + 1
print("Steps = ",steps)

Das könnte Ihnen auch gefallen