The Ministry of Home Affairs and Immigration would like to introduce an automated id number and passport generation system. The system takes into consideration the following:
Your task is to create a program that can achieve the above requirements to assist the ministry automate it’s operations
Input
Input is a single line with the person's first name, date of birth(format YYYY-MM-DD) and five-digit postfix through keyboard input, all separated by single spaces
write a function to add any number of numbers for Eg. add(1,2) add(1,2,3) add(1,2,3,4,5)
How to reverse a string in a given sentence. a. Example: Given string is “ Ram is learning in CCBP Intensive course”. Reverse the word “learning” in the above sentence
import numpy as np
def matrix(m,n):
list1 = []
list2 = []
for i in range(m*n):
inputs = int(input('Enter numbers on intended matrix here: '))
list1.append(inputs)
for i in range(m*n):
order_input = min(list1)
list1.remove(order_input)
list2.append(order_input)
matrix1 = np.array(list2)
matrix2 = matrix1.reshape(m,n)
print(matrix2)
matrix(2,3)
Recreate the pokemon table using Colum by column on the documentation:
Column by column
you can add data one column at a times as well. To do this you use the add_column method, which takes who arguments-a string which is the name for the field the column you are adding corresponds to, and a list or tuple which contains the column data:
x.add_column( "City name",
["Adelaide", "Brisbane", "Darwin", "Hobart", "Sydney", "Melbourne", "Perth", ])
x.add_column("Area", [ 1295,5905, 112, 1357, 2058, 1566, 5386])
x.add_column("Population", [ 1158259, 18557594, 120900, 205556, 4336374, 3306092, 1554769])
x.add_column("Annual Rainfall"[600.5, 1146.4, 1714.7, 619.5, 1214.8, 646.9,
869.4])
Recreate the pokemon table using All rows at once on the documentation:
All rows at once
When you have a list of rows, you can add them in one go with add-row:
x.field_names = [ "City name", "Area", "Population", "Annual Rainfall"]
x.add_row(
[
["Adelaide", 1295, 1158259, 600.5],
["Brisbane'', 5905, 1857594, 1146, 4],
[ "Darwin", 112, 120900, 1714, 7],
["Hobart", 135, 20556, 619.5],
["Sydney", 2058, 4336374, 1214.8],
["Melbourne", 1566, 3806092, 646.9],
["Penth", 5386, 1554769, 869.4],
]
)
Given an M x N matrix find all anti-diagonal elements of the matrix..
input :
the first input will contain values of M, N with separated by spaces..
the second line will contain matrix with M x N dimensions
i.e. input is
4 4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
output:
1
2 5
3 6 9
4 7 10 13
8 11 14
12 15
16
The Airplane always needs to check with the Airport to see if it has an
available runway before it's able to take off or land. Simulate the above-
mentioned scenario using multi-threading. IN python
1. Define a class bicycle
2. Properties: brand, model, year, description, weight_kg
3. Methods: name, weight_lbs, set_weight_lbs
Description:
name - take brand, model and year and put them in a string to output the name of each instance of the bicycle.
weight_lbs - convert from kilogram into pounds. 1kg = 2.2046226218 pounds
set_weight_lbs - is going to be a way that we can pass in a weight, in pounds, and have it converted into kilograms and stored in weight_kg. So you'll be able to set the weight, either by kilograms, or by pounds.
4. Instantiate 2 objects
5. Set and read properties
6. Call all methods