Hello can anyone help solve this please in Python the way it's asked?
a)
print([i*i for i in range(0,26)])
b)
print([str(i)+"**2="+str(i**2) for i in range(0,26)])
c)
print([(a,b,c) for a in range(1,100+1) for b in range(1,100+1) for c in range(1,100+1) if a*a==b*b+c*c ])
d)
lst = ['one','seven','three','two','ten'] print([(len(i),i.upper()) for i in lst])
e)
names = ["Jules Verne","Alexandre Dumas","Morris Druon"] print([n.split()[1]+","+n.split()[0] for n in names ])
f)
def unzip(seq): first,second = [],[] for t in seq: first.append(t[0]) second.append(t[1]) return tuple([first,second]) lst = [(1,"one"),(2,"two"),(3,"three")] print(unzip(lst))
g)
def concatenate(sep,*arg):#*arg is used to take arbirary number of arguments as list if len(arg)==1: return arg[0] else: s = arg[0] for i in range(1,len(arg)): s+=sep+arg[i] return s print(concatenate(':',"one","two","three")) print(concatenate(' and ',"Bonny","Clyde")) print(concatenate('and',"single"))
h)
lst = list(range(0,20)) print(lst[16:10:-1])
i)
lst = list(range(0,20)) print(lst[16:10:-2])
Hello can anyone help solve this please in Python the way it's asked? Question 22 40 pts List Comprehensions Write...
can someone please help me write a python code for this urgently, asap Question: Write a Python function, minmp, that is passed a file name and a metal alloy's formula unit structure*". The file will contain metal elements and their properties. The function will return a tuple of the element from the formula with the lowest melting point and that melting point Write a second function, molform, that will be called by the first function, to take the metal alloy's...
urgent help with python. can somone code this please and show output QUESTION: There are a variety of games possible with a deck of cards. A deck of cards has four different suits, i.e. spades (*), clubs (*), diamonds (), hearts (), and thirteen values for each suit. Now write a function that uses list comprehension to create a deck of cards. Each element in the list will be a card, which is represented by a list containing the suit...
C++ programming question Topic: Class 'Date' Hello everybody, can some one help me... ... Write a class Date with the following properties: a) Data elements of the class are day, month, year. All three data elements are defined by the Type int. b) A set and a get element function are to be provided for each data element. In Within the framework of this task, it should be assumed that the values that are passed for day and year, are...
Assignment 3 In this assignment, you will write a program that plot ASCII text approximations of the Mandelbrot set. Problems Problem 1 Consider the function ?(?,?) defined as follows: ?(?,?)(?, ?) = (?2 − ?2 + ?, 2?? + ?) We define the orbit ?(?, ?) of a point (?, ?) to be an infinite list of items: ?(?, ?) = {(0, 0), ?(?,?)(0, 0), ?(?,?)(?(?,?)(0, 0)), ?(?,?)(?(?,?)(?(?,?)(0, 0))), …} In other words, the nth entry of the list ?(?,...