chevron_left

Recent posts tagged string

0 0 1 min.
**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(filena...
posted Nov 13 Alecxe01 807 points
0 0 2 min.
**Problem:** ======== *I have json file named "panamaleaks50k.json". I want to get ['text'] field from json file but it shows me following error* > the JSON object must be str, bytes or bytearray, not 'TextIOWrapper' **this is my code** with ...
posted Nov 9 Alecxe01 807 points
0 0 1 min.
**Problem :** ========= I am literally trying to start learning **C++**, and I have written very simple code in **C++** as follows for your reference: string mySong(string songlist[], int songnum) { for (i = 0; i < songnum; i...
posted Nov 6 Alecxe01 807 points
0 0 1 min.
**Problem:** ======== I am trying to run a program like import os,sys from scipy import stats import numpy as np f=open('data2.txt', 'r').readlines() N=len(f)-1 for i in range(0,N): w=f[i].split() l1=w[1...
posted Oct 29 Naymul01 996 points
0 0 3 min.
**Problem:** ======== I am quite new in python programming. I have written a simple python that I can’t run. For an unknown reason, it throws me back an error **“cannot concatenate 'str' and 'int' objects”** Here is my sample snippet: n = raw_...
posted Oct 29 Naymul01 996 points
0 0 1 min.
**Problem:** ======== Hello Kodlogs, I am a student of the *Python* programming language. I am taking an online course to learn it. Every day they take classes on each topic and provide some simple problems to solve as an assignment. I had a class...
posted Oct 24 Naymul01 996 points
0 0 1 min.
Problem: -------- Hello all, I am a new student in the **Python** programming language. I am learning through a textbook. I just completed the **String** chapter and started solving the problems of this chapter. Some of the problems are easy to sol...
posted Oct 24 Naymul01 996 points
0 0 1 min.
**Problem:** ======== Well, let’s assume I have a string in python and I am willing to remove all the duplicates characters from my string. Suppose my string is “Australia” the program should return “Austrli” So, my question is simple. How can I **...
posted Oct 23 Naymul01 996 points
0 0 1 min.
**Problem:** ======== Hello, good people of Kodlogs, I am a new student of *Python programming language*. The online course I am taking they are teaching me well. Every weekend they provide me with some problems to solve. This week, I have got the p...
posted Oct 23 Naymul01 996 points
0 0 1 min.
**Problem:** ======== Hello all, I have a sample String. Let’s say it is "my name is gavin" As you can see there is no capital letter in my String. I want to make a program that can replace every first position of each word with a capital wor...
posted Oct 23 Naymul01 996 points
0 0 1 min.
**Problem:** ======== Hello Kodlogs, How can I iterate through characters in a string java? The question comes from a novice in **java**. So, please keep your answer as easier as possible. Note: I can declare a string type in Java. Solution: ---...
posted Oct 23 Naymul01 996 points
0 0 1 min.
**Problem:** ======== Hello all, I’ve installed **python3** and started learning python programming. I am looking for basic problems in different websites and solving them too. I have written a program that should print values inside of a list but ...
posted Oct 23 Naymul01 996 points
0 0 3 min.
How to get last two characters of a string in java So, let us first start perceiving about the concept of string handling in Java. Unlike other programming languages where string is a implemented as a character array, string in Java is an instance ...
posted Oct 23 DivyaN 507 points
0 0 1 min.
Problem: -------- Hello All, I am a novice in Java programming. I am learning Java by taking an online class out of my own curiosity. I am solving basic-level problems from many websites. So far, I was doing good. I get stuck as soon as I get a pro...
posted Oct 22 Naymul01 996 points
0 0 1 min.
**Problem:** ======== Hi, I started adopting the Java programming language a few days back. For the time being, I’ve written a java program that should print values from my **StudentDatabase** using an object of it. Inside my **StudentDatabase**, I...
posted Oct 22 Naymul01 996 points
0 0 1 min.
Problem: Hello all, I am a student of C++ programming. I am wondering if there's an abbreviation or a more elegant way of getting the last character of a string. Let’s assume, the given string is “I am a String” then the output should be **“I am a S...
posted Oct 22 Naymul01 996 points
0 0 1 min.
Problem: -------- Hello programmers, I am a newbie in computer programming. I started learning C plus plus programming a few days back. I enrolled in an online course and doing well so far. Today, I’ve completed the ‘Array’ chapter successfully. I...
posted Oct 21 Naymul01 996 points
0 0 1 min.
**Problem:** ======== I have a **CSV** file and it’s full of lines. Within the **CSV** file, I want to give a count on the number of times a word is being repeated in the reviews string. Therefore I’ve written a python program. I am trying to read t...
posted Oct 21 Naymul01 996 points
0 0 1 min.
**Problem:** ======== Hello Kodlogs, I hope you all are doing good in this pandemic. I was passing a boring time while staying home. One of my friends suggested I start learning computer programming. I picked up the **C++** programming language. At...
posted Oct 20 Naymul01 996 points
0 0 1 min.
**Problem:** ======== Hello all, I am a newbie in **C++** programming. I took up this project of learning with a big dream in my head. Anyway, I am struggling with a problem to figure out the solution. I was finding some basic problems from some web...
posted Oct 20 Naymul01 996 points