Python Mini Programs

Blessings is a great and committed Engineer, She has been very resourceful to the many organization and guset What; She is the brain behind all our python Programs and projects. Learn more about Blessings

Page Updated on Oct 12, 2022.       1st Published on Oct 12, 2022  

Project 1: Basic

Let's assume you are planning to use your Python skills to build a social networking service. You decide to host your application on servers running in the cloud. You pick a hosting provider that charges $0.51 per hour. You will launch your service using one server and want to know how much it will cost to operate per day and per month.
Write a Python program that displays the answers to the following questions:
How much does it cost to operate one server per day?
How much does it cost to operate one server per month?

Program 1-1: string concatenation

Building on the previous example, let's also assume that you have saved $918 to fund your new adventure. You wonder how many days you can keep one server running before your money runs out. Of course, you hope your social network becomes popular and requires 20 servers to keep up with the demand. How much will it cost to operate at that point?
Write a Python program that displays the answers to the following questions:
How much does it cost to operate one server per day?
How much does it cost to operate one server per month?
How much does it cost to operate twenty servers per day?
How much does it cost to operate twenty servers per month?
How many days can I operate one server with $918?

Program 2: Variables

Write a Python program that uses three variables. The variables in your program will be animal, vegetable, and mineral. Assign a string value to each one of the variables. Your program should display "Here is an animal, a vegetable, and a mineral." Next, display the value for animal, followed by vegetable, and finally mineral. Each one of the values should be printed on their own line. Your program will display four lines in total.
Sample Output:
Here is an animal, a vegetable, and a mineral.
cat
broccoli
gold

Program 2-1: String Variables and concatenation

1. Write a program that asks the user to enter a string. The program should then print the following:
(a) The total number of characters in the string
(b) The string repeated 10 times
(c) The first character of the string (remember that string indices start at 0)
(d) The first three characters of the string
(e) The last three characters of the string
(f) The string backwards
(g) The seventh character of the string if the string is long enough and a message otherwise
(h) The string with its first and last characters removed
(i) The string in all caps
(j) The string with every a replaced with an e

Program 2-2:Strings

At a certain school, student email addresses end with @student.college.edu, while professor email addresses end with @prof.college.edu. Write a program that first asks the user how many email addresses they will be entering, and then has the user enter those addresses. After all the email addresses are entered, the program should print out a message indicating either that all the addresses are student addresses or that there were some professor addresses entered

Program 3: Strings and variables

Companies often try to personalize their offers to make them more attractive. One simple way to do this is just to insert the person’s name at various places in the offer. Of course, companies don’t manually type in every person’s name; everything is computer-generated. Write a program that asks the user for their name and then generates an offer like the one below. For simplicity’s sake, you may assume that the person’s first and last names are one word each.
Enter name: George Washington
Dear George Washington,
I am pleased to offer you our new Platinum Plus Rewards card at a special introductory APR of 47.99%. George, an offer like this does not come along every day, so I urge you to call now toll-free at 1-800-314-1592. We cannot offer such a low rate for long, George, so call right away.

For Quick reference and more researche, please click on the links and documents listed below.
If you do not have Python intalled or IDE where you can test your code, please click Here and use w3school space for testing

A Practical Introduction to Python Programming Heinold.

kupdf.net python programming for beginner jason-cannon.

Python_Quick_Reference_Guide_Heinold .

w3schools python tutorials.

Pleas, get back to our Python Course Here if you find difficulties writing this program