• Register
search
Log In

Recent questions tagged typeerror

1 vote
1 answer 3 views
Problem: Hello all, I am a new student of Python programming. I am trying to make a program that will ask for different personal details from the user, and then print them all together in a single line. However, the program is encountering an error of TypeError ... am getting: TypeError: not enough arguments for format string I hope you’ll come forward and help me to save my day. Thanks.
asked 1 day ago adamSw 9.9k points
1 vote
1 answer 4 views
Problem: I am a new student in Python programming. I have made a program that is supposed to take multiple inputs from the user and then print simply. Yeah, I know that sounds pretty easy but I am facing some kind of TypeError from the program. I am attaching the ... am getting is: TypeError: can only concatenate str (not "int") to str What’s wrong here? Thanks for your kind help, mate.
asked Jun 29 adamSw 9.9k points
1 vote
1 answer 5 views
Problem: Hello Kodlogs, I am getting an error TypeError: unhashable type: 'list' while I was doing this: my_dict = {'name': 'John', [1,2,3]:'values'} print(my_dict) As you can see I have declared a simple list and trying to print all the values. I think the ... find out the issue and help me to fix the error. I’ve already spent an hour on this. Please save my day. Thanks for your concern.
asked Jun 28 adamSw 9.9k points
1 vote
1 answer 14 views
Problem: I wrote a program in which gives me the following error : TypeError: startswith first arg must be bytes or a tuple of bytes, not str The program I wrote is: def allFasta(filename): xd = open(filename, 'yb') headers = "" sequence = "" while True: ... ("youn.xd") Why is this type error message is appearing for this program. Is there any problem with my programs arguments? Thanks in advance.
asked Jun 11 samhaz 5k points
1 vote
1 answer 14 views
Problem: I was trying to run the code below: from __future__ import division x = 66 y = 99 z = 33 round((x/y)*0.8*z) But after running this code the console remains blank for sometime and then it shows the error message: Traceback (most recent call last): ... If there is any problem in my code what is that and why this error-type message appears. Please help me to solve this. Thanks in advance.
asked May 16 samhaz 5k points
1 vote
1 answer 24 views
Problem: I wrote the following program in python and it throws me the error message: Please enter your first number: 10 Please enter your secoend number: 5 Addition of your numbers 105 Traceback (most recent call last): File "ires.py", line 9, in <module> ... some wong output and then it throws the error message. Is there any problem in my program thats causing this error? Thanks in advance.
asked May 12 samhaz 5k points
1 vote
1 answer 12 views
Problem: I have a program where I used tuple and it is throwing e some eror message. The code I worte is : import random board = [] for x in range(0,5): board.append(["O"] * 5) def print_board(board): for row in board: print " ".join(row) print_board(board) ... len(board)-1 or guess_col < 0 or guess_col > len(board[0])-1: TypeError: list indices must be integers not tuple How to solve this thing?
asked Apr 27 samhaz 5k points
1 vote
1 answer 16 views
Problem: For the following program of java: public static void main(String[] args) { int A; char a = A; if (Character.isUpperCase()) { System.out.println a + " is an uppercase character."; } } After compiling this code it shows the message: javac -classpath .:/ ... isUpperCase()) { ^ Main.java:6: error: class, interface, or enum expected } ^ 4 errors How to solve this one? Thanks in advance.
asked Apr 27 samhaz 5k points
1 vote
1 answer 18 views
Problem: For the following python program et some error messages. The code: def Yanwa(Array,a): n = len(Array) for column in xrange(n-1): for row in xrange(column+1, n): xmult = Array[row][column] / Array[column][column] Array[row][column] = xmult for col in ... not defined Typeerror: unsupported operand type(s) for -: 'list' and 'list' Can any one sort this problem and help me out to solve this?
asked Apr 27 samhaz 5k points
1 vote
1 answer 39 views
Problem: Hello all, I am trying to play with python and completed writing a code. My codes are supposed to create a new note. Unfortunately, I messed up something in the script and it&rsquo;s not working as I expected. Find my sample script snippet below and have a look ... . So, in the end I am posting here to get responses from you guys. Thanks for your valuable time. I must recognize your help.
asked Apr 26 Gavin 15.2k points
1 vote
1 answer 29 views
Problem: For the following code import re import string import pandas as pd import openpyxl import glob import csv import os import xlsxwriter import numpy as np keywords = {"oracles","mining","ico"} df = pd.read_csv(r"C:MYfile.csv", error_bad_lines=False) sep="," , ... j in df.columns] 21 TypeError: argument of type 'float' is not iterable Can anyone sortout the problem and help me to solve this?
asked Apr 26 samhaz 5k points
1 vote
2 answers 174 views
Problem: Hello all, I am encountering an error with my python script. I am trying to play with map object in my script. Instead of returning a true result, it is throwing an error: typeerror: 'map' object is not subscriptable. What is this error? Literally, ... the error. I am looking forward to having a legit solution to this problem. I must appreciate your concern and valuable help. Thanks all.
asked Apr 25 Gavin 15.2k points
3 votes
1 answer 56 views
Problem: Hello all, I am a novice in python programming. I have started learning python a few days back and I couldn&rsquo;t grasp may thing yet for sure. I have a chunk of python code that produces an error: typeerror: 'nonetype' object is not callable Within my program, ... , have a look into my codes and tell me where I am doing the wrong things. Thanks a lot for your positivity and kind help.
asked Apr 25 Gavin 15.2k points
1 vote
1 answer 17 views
Problem: Take my salutation, guys. I just entered the fold of programming. I was discussing with one of my friends with programming languages and how software development works. My friend inspired me to start learning to program and suggest me to take up the python programming. ... ? Could you please sort out the problem and help me to fix it? I am looking forward to reading your answers. Thanks.
asked Apr 25 Gavin 15.2k points
1 vote
2 answers 494 views
Problem: I wrote a code in python but it throws me a error message: Please enter your number: 13 Traceback (most recent call last): File "tst.py", line 20, in <module> (lub, sup) = fib_intervall(a) TypeError: cannot unpack non-iterable NoneType object The code I ... me but after that the code is not running and throwing me this error message. Is there any problem in my code and how to solve this?
asked Apr 24 samhaz 5k points
1 vote
1 answer 17 views
Problem: For the following code I got some errors. The code I wrote is: def algo(n,b,a): assert(b > 1) x = n y = 0 while x != 0: a[y] = x % b x = x / b ++y return y print (algo(1,333,666)) print (algo(11,333,666)) print (algo(111,1001,99)) ... 666)) File "tar.py", line 6, in algo a[y] = x % b TypeError: 'int' object does not support item assignment Why am I getting this error can anyone explain?
asked Apr 21 samhaz 5k points
1 vote
1 answer 55 views
Problem: I made a tuple to add to my main program . But this thing does not seem to work . I wrote this code: print("You should study hard to pass the exam") exam=("Study","Pc","python") print ("The things I have :") for stuff in exam: print (stuff) ... <module> exam += extra TypeError: can only concatenate tuple (not "str") to tuple Can anyone sort out this problem and help me out to solve this?
asked Apr 21 samhaz 5k points
1 vote
1 answer 18 views
Problem: I want to create a python script that should take input from the user and compare the value with zero. Every time the script should print a positive integer number. It doesn&rsquo;t matter what the user has given as an input. Let&rsquo;s say the user has ... ) I am a novice in python programming. So please keep your solution as simple as possible. I appreciate your help a lot. Thanks.
asked Apr 12 Gavin 15.2k points
1 vote
1 answer 41 views
Problem: I am trying to print some string in my python program but for some reason, it&rsquo;s not working. The compiler says python syntaxerror: EOL while scanning string literal that is totally beyond my understandings. For obvious reason, I am avoiding my original code and ... test string" print(mystr) printStr() Here is the dummy code snippet. Please pull me up from the problem. Thanks to all.
asked Apr 7 Gavin 15.2k points
2 votes
1 answer 23 views
Problem: What is TypeError: 'list' object is not callable error in python programming? Why does it happen? I was trying to working with a list in python. Suddenly, I got this error while I was trying run this below code list = [1, 2, 3] myrange = list(range(1, 10)) for num in list: if num in myrange: print(num, 'is between 1 and 10') Could any of you please shed some light on this?
asked Apr 7 Gavin 15.2k points