I would like to receive an input from the user without having to press enter in python 3. I’ve seen people use "getch" but I need to be able to run this in the shell, and getch doesn’t seem to work too smoothly with that. All I need is something like this: myVariable = raw_input() ..
I’ve been playing with python, trying to think of some string problems for my nephew, and the program I "thought of" was to "implement" in a loose sense the cd, cd.. and pwd commands using strings. pwd = "home" cdDot =  run = 1 cd = 0 while(run): x = input() if(x == "pwd"): ..
I have written a small application in which a user clicks regions of an image to label, then labels that region of the image with a string. I use openCV’s onMouseCallback() to manage the clicks, and I read strings in using the input() function. However, this is a less-than-desirable solution because the user must click ..
I want to insert a list of integer separted by newline like this input = arr = 4n6n-2n3n-1n so that I can get the list like this: output = [4,6,-2,3,-1] But I don’t know how to do it. I used split(‘n’) and splitlines() but it give output like this: input = 4n6n-2n3n-1 output = Traceback ..
So I am practicing in hacker earth and I have to take two inputs in a single line separated by space. The below code is what I used: x, y = [x for x in input("Enter two value: ").split()] It is supposed to take input that looks like ‘2 5’ And it is returning an ..
Hey folks I’m hard time programming an input validation on Python. With very very very limited tools I have to validate a string and if it passes the validation I get to turn it into an integer using int(). I am NOT allowed to use: split() isdigit() isnumeric() def continue break try except I thought ..
store = input("Store name:") noun = input("Noun:") print("’Im going to ‘he said. What do you want me to buy?") I want to add the variable inside the escaped string so when the user inputs a name, it would print ‘Im going to (store name)’ Could anybody tell me where I went wrong and how to ..
Hey I wanted to know how to work with an array as functional argument in Python. I will show a short example: def polynom(x, coeff_arr): return coeff_arr+ coeff_arr+x +coeff_arr*x**2 I obviously get the error that 2 positional arguments are needed but 4 were given when I try to run it, can anybody tell me how ..
I’m new to phyton. How can I put user inputs into an excel file? I’m planning to ask the students’ name, year, and program to make a "database" or list in excel. Is that possible? Can you please help me huhu Thank you so much <33 Source: Python..
the code is supposed to print 🙂 based on the number inputted (an integer 1 to 10). with any positive integer, the code is supposed to print that many smiley faces (ex. if 5 is entered, 5 smiley faces should be printed) it’s required that the code should use += to add onto the end ..