Reverse a string and calculate unchanged positions to the original string?
To find the lucky number.
Input - 8, Output - 21
Write an algorithm to make a list like 1,1,2,3,5,8,13,21 so when input 8 is entered it
should give output 21
Write a program to print maximum and minimum prime numbers in a given range?
Input two strings in one line, separated by a space.
Concatenate the two strings and print out the result.
Write a program to count the characters that are not words, integers, spaces
Input one string and one integer, make sure they are on different lines.
Print out the string and integer in one line separated by a space.
Run this code on python and takes a photo of the codes and the output: Show it to me
main_list = []
x = {}
field_names = [ "City name", "Area", "Population", "Annual Rainfall"]
list1 = [
["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],
["Perth", 5386, 1554769, 869.4]
]
for i in range(0, len(list1)):
for key in field_names:
#Below lines indented
for value in list1[i]:
x[key] = value
list1[i].remove(value)
break
main_list.append(x)
print(main_list)
Run this code and take a photos of code and the output on python
from prettytable import PrettyTable
table = PrettyTable()
table.field_names = ["pokemon name", "type"]
table.add_row(["pikachu", "Electric"])
table.add_row(["sydney", "Dark"])
table.add_row(["charmander", "Fire"])
table.add_row(["squite", "Water"])
print(table)
The manager of company has asked his assistant to present him with
the list the ages of all the workers working in manufacturing division
who are having the experience of 20 years. The assistant of thee
manager replied him with the list of 10 employees who are having the
experience of 20 years. Write a program that store the age of all 15
employees in 1D array and then print the total count of employees
whose age lies between 50 and 60. Use functions to solve this task
PLEASE SOLVE IT USING PYTHON
Input Format ->57 49 54 48 59 55 46 57 58 60 58 62 56 70 73
Constraints-> The Age of the employees should be greater than or equal to 40 and less than or equal to 60. If constraints do not match then show "wrong input"
Output Format - EXAMPLE 8 EMPLOYEES
Run this code and recheck the wrong, and show me the codes and the output
class AddColumn:
def add_column(str1,list1):
dict1[str1].append(list1)
x=AddColumn()
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])
print(dict1)