No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hello dear community Now i've tried to fix this error myself for countless of days. The error is following: My computer now and then doesnt recognize that i've got a ethernet cable plugged in to my computer. The internet work all times on all of the other 3 computers in … |
|
Here's the problem. I'm using pythons re-functions. I'm supposed to make a re-function to check if a string ends with 3 numbers(or more) before the extension.(e.g. 123.txt, 93821.ini) Here's my code that's supposed to do the magic [code] re.search('[0-9][0-9][0-9]\.','1234.txt') [/code] now, this doesn't work out. And I have no clue … |
|
My prob' is that when I type 'Amanda' when the program asks for my name, it returns Hi. I want it to return Howdy when I input 'Amanda', and hello for all other strings. This is my program: [CODE]#include <stdio.h> int main() { int nothing; char namn[20]; printf("What's your name?\n"); … |
|
I want make a program that calculates the cartesian products of two sets. e.g.: This is how i would like the result to look like: >>> Enter two sets to calculate the cartesian product: set([7,9]), set([1,5]) set([(7,1),(9,1),(7,5),(9,5)]) [CODE]def main(): userinput = input('Enter two sets to calculate the cartesian product: ') … |
|
This is my program: [CODE]def main(): print('This is a program to calculate the setprod') print() userinput = input('Enter two sets separated by a comma: ') value1, value2 = userinput.split(',') mylist1 = eval(value1.strip()) mylist2 = eval(value2.strip()) print(mylist1 + mylist2) main()[/CODE] If I enter following: [CODE]>>> This is a program to calculate … |
|
Ok my program looks like this: [CODE]U = set([0,1,2,3,4,5,6,7,8,9]) A = set([2,4,5]) B = set([5,8]) C = set([5]) def main(): print('This is a program to give complement to given elements') x = input('Enter elements bla bla: ') y = U.difference(x) print('The complement of given elements are:', y) main()[/CODE] As you … |
|
Alright, this is how my newest program looks like: [CODE]import math def main(): print('This program finds the real solutions to a quadratic') print s = float(input('Please enter the coefficients (a,b,c): ')) a, b, c = s.split(',') discRoot = float(math.sqrt(b * b - 4 * a * c)) root1 = (-b … |
|
Here is my program: [I]#avg2.py # A simple program to average two exam scores # Illustrates use of multiple input def main(): print('This is a program to average two exam scores') score1, score2 = float(input('Enter two scores separated by a comma: ')) average = (score1 + score2) / 2.0 print('The … |
|
I've got a book for python 2. in school and the problem is that we're programming in 3. which makes it difficult from time to time to get it right, cause you cant just copy the text in the book to the shell. I'm stuck with this ex: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # … |