Category : input

Problem statement – Take 3 numbers as input array (without using map function) and print the min and max values in the array My solution- arr = input("Enter numbers ") #1 2 3 print(min(arr)) #returns empty print(max(arr)) #returns 3 Question- Why does max(arr) return the correct output and min(Arr) return an empty string? Source: Python ..

Read more

I’m trying to make a rock paper scissors game but this stops it, im a very python beginner. jj = (str(input("Do you want to play a Rock Paper scissors game?(Y = yes , N = no ): "))“` if (jj) == (y): print() elif (jj) == (n): print("Ok Your loss ")**** Error: File "main.py", line ..

Read more

In the following contrived example I am attempting to get input from stdin and call a list of coroutine tasks based on the input from STDIN.: import asyncio from time import sleep async def task_1(): print(‘task_1!’) async def task_2(): print(‘task_2!’) async def task_3(): print(‘task_3!’) async def task_4(): print(‘task_4!’) async def main(): opts = { ‘1’: ..

Read more