i’d like to give a row of bulk numbers and print their 10% (*0.1): 1000 2000 3500 print results –> 100 200 350 Do i do this basic example with Python? Any suggestion appreciated Source: Python..
How to count the number of occurrences of the invalid input when the user enter the wrong input. I would like to count how many times the words "invalid input " appears. Here’s my code. Please assist me. while True: number = input("Enter a. number: ") if number.isdigit(): print("The input is valid.") else: print("Invalid input.") ..
I am a little confused why the return statement won’t work if I’m calling a function but will when I am printing it. Below is the example of code I worked with. def get_favorite_food(): food = input("What’s your favorite food?") return ‘Your favorite food’ + ‘ ‘ + food + ‘ ‘ + ‘is ready!’ ..
i just want multi choice questions, and the script not show logo and questions… #!/usr/bin/env python3 import os,re,sys magic = ”’ .$$ /$$ /$$ /$$$$$$$ | $$$ /$$$ |__/ | $$__ $$ | $$$$ /$$$$ /$$$$$$ /$$$$$$ /$$ /$$$$$$$ | $$ $$ /$$$$$$ /$$$$$$ /$$ /$$ /$$ /$$ | $$ $$/$$ $$ |____ $$ /$$__ ..
I am solving a question on CodeChef: https://www.codechef.com/SNCKQL21/problems/MAXDISTKT The problem doesn’t really matter, it is more the text cursor in my input/output that is causing a problem. Here is the input: First-line will contain T, the number of test cases. Then the test cases follow. Each test case contains two lines of input. First-line contains ..
Right now my array prints like this: [[ 1.5531e-01 -4.6594e-02 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00] [-4.6594e-02 1.5531e-01 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00] [ 0.0000e+00 0.0000e+00 4.0381e-01 0.0000e+00 0.0000e+00 0.0000e+00] [-0.0000e+00 -0.0000e+00 -0.0000e+00 1.9826e+03 -5.9479e+02 -0.0000e+00] [ 0.0000e+00 0.0000e+00 0.0000e+00 -5.9479e+02 1.9826e+03 0.0000e+00] [ 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 5.1549e+03]] What I would like is: [[ 1.4531e-01 -4.6594e-02 ..
I need to "talk" with the printer to "get" the information such as out of paper, running out of paper, paper jam, in my code I only receive an array as a return using pyusb. I would be very grateful if someone could help me! import usb.core import usb.util import time dev = usb.core.find(idVendor=0x20d1, idProduct=0x7008) ..
I’m new to this community and I’m currently learning Python. For my first little project, I want to ask the user for input (An element from the periodic table) and print the corresponding properties such as name, number and mass. import pandas as pd df = pd.read_excel(r’pathexcelfile.xlsx’) Symbol = input(‘Input Symbol: ‘) try: value = ..
guys I am currently studying python. I faced issues which is how to print out this tkinter in a frame So, now with my code. it is just print out like; A 13:00pm 17:00pm B C High but I want organize this date look like; ex) Also how to make calculate function and print out ..
#this code creates an interface to generate barcodes with a selected printer import barcode import win32api import os from tkinter import * from tkinter import ttk from tkinter import font as tkFont import win32api import win32print import win32ui from glob import glob from PIL import Image, ImageWin from barcode.base import Barcode from barcode.writer import ImageWriter ..