Farheen Palagiri

@FARHEENPALAGIRI (10)
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
3
Help needed
Ask
Hey everyone, it's me. Again. And, as usual, I am an idiot and can't figure out how to write this code. Help me please? Okay so I'm writing this code
Read full post
Brandaboss
Brandaboss This works for me: N = int(input("Amount of numbers: ")) total = 0 for i in range(N): numb = int(input("Number "+str(i+1)+": ")) total += numb print(total) Tell me if it helps.3 years ago
TopZek
TopZek I think you should send HappyFakeboulde the multiplayer link ; copy the code down first if he accidentally erases it.3 years ago
HappyFakeboulde
HappyFakeboulde can you please give a link to the repl instead of pasting in the code?3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
3
Technical Problems
Ask
Hello everyone. Quick question: when you are using REPL to code, does the terminal ever blank out on you? It does that to me all the time and it's rea
TheDrone7
TheDrone7 Yes, that does happen sometimes to me as well. As a quick workaround, I open the shell by pressing the F1 key and then typing Open Shell in the search box that pops up. In case F1 doesn't work, you can also do Ctrl + Shift + P and then use the command line commands to run the repl. Unfortunately, this isn't a permanent fix and only a quick workaround, it should help with debugging.3 years ago
a5rocks
a5rocks At the very least, I don't. Sometime my terminal takes a while to load, or just is stuck loading, but even then I don't care because I don't use it much. Though, once I used repl on tor, and the console wouldn't show anything. (probably just an out of date browser in that case) You could submit a bug report and/or screenshots here : https://repl.it/bugs3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
3
Debug Mode on REPL
Ask
Hello everyone! Me again. I have a question, but it's fairly straightforward. It's not exactly about code. How does the Debug Mode work on REPL?
Babbel
Babbel wanted to ask that too. nothing happens when pressing the start button3 years ago
PAULX
PAULX It's also wondering me.3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
2
Not a coding question (for once)
Ask
Hi everybody, it's me again. Don't worry I'm not going to bother you about codes that I find really difficult (yet), I'm just honestly curious about
John_WardWard
John_WardWard @FAHREENPALAGARI Please don't curse!3 years ago
21natzil
21natzil What about "12.43".split(".")1?3 years ago
pyelias
pyelias I think what happens here is that once you think of a solution, you just use it without consider other possible approaches. Planning is always helpful. (and if your code is too complicated, you're probably doing something wrong) Even most large projects I've worked on usually have simple code, just a lot of it.3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
2
I'm annoying, I know, I just really suck at this
Ask
Hi. Me again. I know I'm probably really annoying you all with my constant questions, but I just really suck at this. I've been working on this code f
FARHEENPALAGIRI
FARHEENPALAGIRI I had a seriously hard time doing this code3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI Thanks a lot3 years ago
Geocube101
Geocube101 You can do 'split(".")' to split the float into the numbers before and after the decimal point. #Get input as string a = input() #Split string around point b = a.split(".") #Print Part 2 (All objects after the point) print(b[1])3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
2
Hi everyone
Ask
Hey guys. Me again. I need help. Serious help. Like, I've-been-working-for- almost-2-hours-and-have-no-idea-what-is-happening help. I'm just gonna pos
a5rocks
a5rocks Why are you repeating the for loop length of the string times? Also, why s.replace? https://stackoverflow.com/questions/14198497/remove-char-at-specific-index-python Also, what it total doing? Thats all I could find quickly.3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
1
Sorry
Ask
Hi. I'm sorry, I ran into a problem. Just one quick question: I want the answer of two different equations in one sentence(sentence? idk). I tried t
freddyamarsden
freddyamarsden Theres no need to say sorry.3 years ago
pyelias
pyelias To solve this problem, I'd check the documentation for print. It says: > print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False) > Print objects to the text stream file, separated by sep and followed by end... The ` before objects means that there can be multiple objects printed. So, you would use print(x y, z * y)` to print both things in one line.3 years ago
JosephBarroso
JosephBarroso Can you post your code? It'd be easier to find what the problem was if I can see the code :)3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
1
Hi. Me again
Ask
Hey everyone. I have a not-so-slight issue. So for this code I'm writing, a three digit number is inputted, and if the digits are in ascending order t
Geocube101
Geocube101 You could just get the input and send it to an array: a = list(input()) which should return the input as a list with each character as an element (You then need to iterate through and convert each element to an integer via int() method). From there, you can make another list and call the sorted() function to sort it. Compare the first list with the second sorted list and done! If they match, it should return True. a = list(input()) for b in range(len(a)): --a[b] = int(a[b]) c = sorted(a) if a =3 years ago
ash15khng
ash15khng You could do something like numlist2 = [int(num) for num in num_list] This is called a list comprehension and is basically a shorter way of writing numlist2 = [] for num in num_list: numlist2.append(num) If you want to use your code, change line 3 to numlist2 = list(map(int, num_list)). map() returns a map object, not a list, so you need to turn in into a list by adding list() in front of it.3 years ago
HappyFakeboulde
HappyFakeboulde AFAIK map doesn't return a list, it returns an iterator. I could be wrong though :shrug:.3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
1
HELP ME!!!!!!!!!!!!!!!
Ask
So I was trying to write this code for this situation: Write a program that reads an integer number and prints its previous and next numbers To solv
AzureScripts
AzureScripts I have done what you tried to do in one of my repls: https://repl.it/@AzureScripts/Integer-Help It is working and it has the same function as you tried to make! Take a look and tell me if this works3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI Thank you3 years ago
CoolqB
CoolqB The problem here is you're trying to add a string type to an integer. You cannot add a string (a bunch of letters) and a number, because you just can't. To fix this, using the str() function (short for string), tell python to turn the numbers into a string. Try this: print ("the number after " + str(a) + "is " + str(previous)). This is a simplified version of what's really going on here, so I recommend you look up about datatypes, it'll help you a lot!3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
1
hey everybody
Ask
Hi everybody. It's me again. And I'm still stuck on the same code despite all your effort to help me. I'm sorry. But could someone please explain to m
a5rocks
a5rocks Here is something that should work. It uses modular arithmetic to find the third character, and uses continue to skip an interation. Both these are great tools, and I think you should check them out. Anyway, here : start = input('Your string? ') end = '' for i in range(len(start)): if i%3 == 2: continue end += start[i] print(end) Another thing is that you should join the repl.it discord (https://discord.gg/XadDsju), in which you would be able to get more comprehensive help.3 years ago
Nanashi
Nanashi As of writing, you have this: s = input() x = 0 for i in range(len(s)): if x > len(s): break else: l = s[x] s2 = s.replace(l,'') x += 3 print(s2) And you are getting IndexError: string index out of range. Your code will actually run on a string of length 7 or 8 but not 6 or multiples of 3. Why? When x becomes 6, l tries to become s[6], meaning the character from indices 6 to 7 (equivalent to s[6:7]), but s has length of 6 not 7 therefore the index is out of range. To stop it3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
1
Hey everyone
Ask
Hello everyone. How are you? I'm back, so you're probably annoyed. So, anyways, I was writing this code, and I'm not sure how to do something. Help me
FARHEENPALAGIRI
FARHEENPALAGIRI Thanks a lot!3 years ago
ArchieMaclean
ArchieMaclean if (a[e]+1)==a[e+1] or (a[e]-1)==a[e+1]: print(a[e]+" "+a[e+1] Please upvote if this helps :)3 years ago
Scoder12
Scoder12 What is the variable e for? couldn't you just use i? As for the solution, just set a variable, such as done to False at the beginning of your program and set it to true if you find a pair. If the variable is still false when you are done with the loop, print 0. > I am repl.it helper. If this is a good answer, please upvote!3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
1
I'm desperate
Ask
Hey guys. Wassup?? Well, I was trying to write this code for like two days now and I am just extremely stuck. Like can someone please help me?? I am s
FARHEENPALAGIRI
FARHEENPALAGIRI Why shouldn't I use eval?? Does it not always work??3 years ago
PYer
PYer Instead of using eval() (Don't it is bad practice) you could just do y = int(x). When you divide a number by another, the answer is always a float (With decimal point), which you then can convert into an integer with the int() function.3 years ago
mat1
mat1 Never ever ever ever use eval(). Use int() to automatically convert it to an integer instead > Please upvote my comment if it was helpful or useful in any way :)3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
1
I need help
Ask
Hi everyone. Me again. I need help with a program I'm working on (as usual). So in this code there are two numbers inputted. If exactly one is negativ
CodeLongAndPros
CodeLongAndPros Here's how I would do it: a = int(input()) b = int(input()) if (abs(a) == a or abs(b) == b) and (abs(b) != b or abs(a) != a): print("YES") else: print("NO") `2 years ago
safan41
safan41 your first if statement checks for if a < 0, which input precedes to be true, meaning the elifs after that won't run. try to put the most specific conditional statements first then down to the least specific. (e.g. if a < 0 and b < 0: ... elif a < 0: ... )3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
1
Serious help necessary
Ask
Okay so I am trying to write a code where you enter a number, any number, and the program will print the last two digits. So code I wrote basically tu
FARHEENPALAGIRI
FARHEENPALAGIRI I've been working on this for about 2 hours3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI OMG thank you so much3 years ago
Geocube101
Geocube101 You cannot subtract an int from a string or a list (Line: 4) Anyway, I subtracted 2 from 'strnum' and added a for loop to remove the first number in 'numlist'. Once done, the result is joined into a string and printed. New Code: https://repl.it/@Geocube101/Ask-For-FARHEENPALAGIRI3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
1
Help please :)
Ask
Hi everyone. I've been working on this code for like three weeks and I have no idea how to do it. So basically the code tells you how many pairs of eq
Pairs of numbers
Python
ash15khng
ash15khng Line 9, when length of a is 1, you should get a[0].3 years ago
mwilki7
mwilki7 Just a few questions to help me know how the program should behave. What is an equal pair? Is the array layed out like: [ [a,b], [c,d], ......, ] or [ a, b, ..., ] Does a list containing [1,1,1] have 2 equal pairs?3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
1
Help please
Ask
Hi everyone. It's your's truly. I have absolutely no idea what it is that I am supposed to do here on this code that I am working on. So I was told on
Mosrod
Mosrod Could you copy and paste the code into a new repl?3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
1
Hey everyone! It's me again
Ask
Hi everybody, it's me again. I need you to look at something. So the situation was that a school was replacing the desks of 3 classrooms. Each desk ho
OmniShift
OmniShift Since you want to calculate for each classroom separately, you should put the input results in a list and loop over it. For each value, use math.ceil as you did and add the result to the total. Its very close to what you already had, just looped and in a slightly different order :)3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
1
I am so confused and so very desperate for help
Ask
Help me please. I have no idea how I'm supposed to do this. So I've been working on this code, and (to me at least) it's very confusing. So the input
CoolqB
CoolqB Your question is a little vague, are you trying to find the number of degrees between the minute hand and hour hand when the hour is at a certain degree? If so, the answer is fortunately fairly simple: hours * 30, since a full circle is 360 degrees, every hour is worth 360 / 12 = 30.3 years ago
FARHEENPALAGIRI
FARHEENPALAGIRI
shared a Post
3 years ago
1
Hello Everyone
Ask
Hi there, everyone. How are you? Good? Great. Me? Not so much. I have, you guessed it, run into a coding problem. I have absolutely no idea how to do