Self-Descriptive Numbers Program
Practity Blog
by Practity
2d ago
Self-Descriptive Numbers Program Coding Project in Python Write a Python program that asks the user to enter a number and checks whether the number is self-descriptive. Considering the digit positions are labeled 0 to N-1, it is a self-descriptive number if the digit in each position is equal to the number of times that digit appears in the number. For example: 2020 is a self-descriptive number beacause: Position 0 is 2 and there are two 0’s in the number Position 1 is 0 and 1 doesn´t appear. Position 2 is 2 and 2 appears twice in the number. Position 3 is 0 and there are no 3 0’s Steps Inp ..read more
Visit website
Word Pattern Finder
Practity Blog
by Practity
2d ago
Word Pattern Finder Python problem for intermediates   Write a Python program to find patterns in words. The input of the program will be the following list of words: ‘ballooned’,’inheritance’ ,’combination’,’despite’,’pommee’ ,’rainfall’,’inches’, ‘seek’,’highest’,’trustworthiness’, ‘caribbean’, ‘experience’,’coffee’, ‘spike’,’greenness’,’wheelless’,’unneeded’,’writers’,’content’,’showcase’, ‘accessily’,’successfully’,’authenticity’,’several’, ‘introductory’,’programming’,’classes’,’occurrence’,’checkers’, ‘board’ The program should check if any of the words in the list match the followi ..read more
Visit website
Largest and Smallest Integers Combinations
Practity Blog
by Practity
4d ago
Largest and Smallest Integers Combinations Python Practice Exercise Given a list of integers separated by a single space, write a Python script that prints out the largest and smallest values that can be obtained by concatenating the integers together. The program should ask the user to enter the integers. Steps Take Input: Read the list of integers from the standard input. Generate Combinations: Generate all possible combinations of the integers by concatenating them together. Find Largest and Smallest: Identify the largest and smallest values from the generated combinations. Displa ..read more
Visit website
Die Hard 3 Jugs Problem
Practity Blog
by Practity
4d ago
Die Hard 3 Jugs Problem with Python   Write a Python program that simulates the process of obtaining exactly 4 liters of water using two buckets. The first bucket can hold 3 liters (m), and the second bucket can hold 5 liters (n). You have the following actions available: fill a bucket until it is full, empty a bucket completely, or transfer water from one bucket to the other until the target bucket is full. Your program should iterate through the actions and keep track of the contents of each bucket (m and n) at each step. The program should continue until exactly 4 liters of water are o ..read more
Visit website
Barcode Validator Project
Practity Blog
by Practity
4d ago
Barcode Validator Python Code Project Barcodes are 12th digit numbers to identify products used worldwide. The last digit is a redundant check digit, used to catch errors. Using some simple calculations, a scanner can determine, given the first 11 digits, what the check digit must be for a valid code. The goal of this Python code project is to write a  Python program to check whether a barcode is valid based on the following rules: Sum the digits at odd-numbered positions (1st, 3rd, 5th, …, 11th). Multiply the result from step 1 by 3. Take the sum of digits at even-numbered positions (2n ..read more
Visit website
Shipping Container Optimization Project
Practity Blog
by Practity
6d ago
Shipping Container Optimization Project   You work in a shipping company and you are responsible for the containers optimization. Your task is to load contaniers with the maximum number of packages so that the company doesn’t waste space. To do so, you decide to build a simple program using Python to automate these tasks. Given a 2D container of length X and height Y to ship packages of standard length x and height y. Assume all sizes are integers. Write a Python program that request the manager to enter the container and packages sizes and calculates how many packages can be sent in the ..read more
Visit website
Sort Exercise
Practity Blog
by Practity
1w ago
Sort Exercise with Python   Write a Python program to sort the elements of the following array in ascending order, using the specified pair-wise dealing method: Array: [86, 3, 9, 15, 6, 7, 10, 18] – Start by comparing and swapping the first pair of elements. – Then, compare and swap the second element with the first element. – Next, compare and swap the third element with the second element, and then with the first element. – Continue this process, comparing and swapping elements in reverse order until the first element. – If no swaps are needed in a stage, abandon the entire stage. – The ..read more
Visit website
Fungi Reproduction
Practity Blog
by Practity
1w ago
Fungi Reproduction Problem Python Practice Question   Many species can reproduce asexually. After 7 days, some fungi can produce another 3 fungi on a day. Starting at the beginning of day 1, how many fungi could it be by the end of day 20? For example, at the end of day 1 there will be 4 fungi: The original plus 3 new ones. The goal of this Python practice question is to write a program to calculate and display the number of fungi at end of the day 20. Source Code # Step 1: Initialize variables num_fungi = 1 # Initial number of fungi num_days = 20 # Number of days to simulate # Step 2 ..read more
Visit website
Budget Tracker Program
Practity Blog
by Practity
1w ago
Budget Tracker Program Python Coding Practice Write a Python program to create a household budget tracker. The program should take the following fixed expenses as input: – Electricity: $95 – Netflix: $15 – Phone: $45 – Gasoline: $135 – Supermarket: $660 – Car insurance: $420 – Rent: $1100 Additionally, the program should ask the user to input any additional expenses or income. To indicate whether the input amount is an expense or income: If the first character is “I”, consider it as income and add it to the final balance. If the first character is “E”, consider it as an expense. The program ..read more
Visit website
Color Format Converter Project
Practity Blog
by Practity
1w ago
Color Format Converter Project Programming Project in Python The RGB color model is an additive model in which red, green, and blue light are added together in various ways to reproduce a broad array of colors. It is the most common color model used in electronic displays, such as televisions, computer monitors, and digital cameras. RGB defines the level of red (R), green (G), and blue (B) through integers from 0 to 255. On the other hand, the CMYK format defines the amount of cyan (C), magenta (M), yellow (Y), and black (K) on a real scale from 0 to 1. The mathematical formulas for converting ..read more
Visit website

Follow Practity Blog on FeedSpot

Continue with Google
Continue with Apple
OR