-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBasics_Challenge.py
74 lines (51 loc) · 3.13 KB
/
Basics_Challenge.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#1 Ask for the user's first name and display the output message
#firstname = input("Please enter your name:")
#print("Hello",firstname)
#2 Ask for the username and surname and then display the output
#firstname = input("Enter your firstname: ")
#surname = input("Enter your surname: ")
#print(firstname,surname)
#3 Write a code that will display "What do you call a bear with no teeth?" and on the next line display "A gummy bear!". Write a single line of code for that
#print("What do you call a bear without teeth? \n A gummy bear!")
#4 Ask the user to enter two numbers. Add them together and display the answer as The total is [answer]
#num1 = int(input("Enter the first number: "))
# num2 = int(input("Enter the second number: "))
# answer = num1 + num2
# print("The answer is", answer)
#5 Ask the user to enter three numbers. Add together the two numbers and then multiply this total by the third. Display answer is [answer]
# num1 = int(input("Enter the first number : "))
# num2 = int(input("Enter the second number : "))
# num3 = int(input("Enter the third number : "))
# answer = ( num1 + num2 ) * num3
# print("The answer is : ",answer)
#6 Ask how many slices of pizza the user started with and ask how many slices they have eaten . Work out how many slices they have left and display the aser in a user friendly format
# total_slices = int(input("Please!, Enter the pizza slices you start with :"))
# slices = int(input("Please!, Enter the pizza slices you have eaten :"))
# remaining = total_slices - slices
# print("Only", remaining , "slices have left")
#7 Ask the user for their name and their age. Add 1 to their age and display the output [Name] next birthday you will be [new age]
# name = input("Enter your name : ")
# age = int(input("Enter your age : "))
# new_age = age + 1
# print(name, "next birthday you will be ", new_age)
#8 Ask for the total price of the bill, then ask how many diners there are. Divide the total bill by the number of diners and show how much each person must pay.
# total = int(input("Please! Enter your total bill :"))
# dinner = int(input("Enter the number of peoples having dinner : "))
# print("The total bill amount is : ",total)
# each_person_pay = total/dinner
# print(each_person_pay,"have to paid by each person ")
#9 Write a program that will ask for a number of days and then will show how many hours, minutes and seconds are in that number of days
# days = int(input("Enter the number of days :"))
# hours = days*24
# minutes = hours*60
# seconds = minutes*60
# print("This day have", hours ,"hours", minutes, "minutes", seconds, "seconds")
#10 There are 2,204 pounds in a kilogram. Ask the user to enter a weight in kilogram and convert it in pounds
# weight = int(input("Enter the weight(in kilogram) : "))
# pound = 2204*weight
# print("This weight have", pound, "pounds")
#11 Task the user to enter a number over 100 and then enter a number under 10 and tell them how many times the smaller number goes into the larger number in a user friendy format
# num1 = int(input("Enter a number over 100 :"))
# num2 = int(input("Enter a number over 10 :"))
# answer = num1 // num2
# print(num2, "goes into", num1, "times")