Hi, I'm working on a small game where the computer generates a number, and you have to input (like guess) a random number. Then, the computer will tell you whether the guessed number is too big or too small, or if you guessed it right.
I might not have imported the random number correctly, but...
Hello, I wanted to ask for a shortcut to mark multiple lines and put them as comment, I don't mind if each line has # at the beginning
for example:
The code is:
1. print("hello world")
2. print("hello world")
3. print("hello world")
I want to make it:
1. # print("hello world")
2. # print("hello...
This is what I have so far. I'm told it's not acceptable. Any ideas on a different way to do this? I have to use loops
def print_pyramid(str,h):
if str=="right":
for i in range(h):
print('#' * (i+1))
elif str=="left":
for i in range(h):
print('...
<start = dt.datetime(2022,1,1)
end = dt.datetime(2023,1,1)
dates = pd.date_range (start,end,freq='20D')
print(dates)>
I am the definition of a newbie to python, not to mention the pandas extension, That being said is there any way that I can have the pd.date_range() line count from the end...
Hello everyone!
I am kind of new in programming and I have some troubles learning and I was wondering; is programming really for everyone?
I am 19 years old and I've been mostly editing codes rather then making own (with no intention of stealing but just messing around to have fun).
I've tried...
Please find attached a screenshot of an error message pertaining to my code from an exercise in list methods in Python, specifically count() and index(). If anyone has any constructive criticisms or suggestions, I will be most grateful. Many thanks in advance for all your help.
Hi all, first post here.
Working on a project for corp, we take in lots of emails and need to process them accordingly, my role is to automate this process however possible..
What I've done so far:
- Grab the email, convert it out of .msg format and into a more friendly format.
- Developed the...
Please see a directive which I am having trouble fulfilling:
# Use upper() on place: place_up
place_up = upper(place, place_up)
I received this error message:
NameError: name 'upper' is not defined
Please see the code in context, attached. There are probably more errors which I have not...
import cv2
damaged_image = cv2.imread("Corrupted.png")
mask = cv2.imread("mask.png", 0)
output = cv2.inpaint(damaged_image, mask, 1, cv2.INPAINT_TELEA)
cv2.imshow('test', output)
cv2.waitKey(0)
cv2.destroyAllWindows()
I couldn't generate mask with python, i have drawn the mask by using Paint...
Hi,
I'm having some issues with this section of my code, it has errors in Terminal and the feedback isn't very specific. Thanks!!
import turtle
import time
variable1=turtle
# turtle object
#img_turtle = Turtle.fish()
#turtle.register_shape('turtle.gif')
#img_turtle.shape('turtle.gif')
speed =...
Suppose every day you wake up and you are randomly in a GOOD mood 60% of the time or in a BAD mood 40% of the time. Furthermore, anytime you have a quiz or test in a course, the grade you receive is also random based on the following:
If you take a quiz or exam when you are in a GOOD mood...
Hi, im currently using Python's Flask to create a dashboard and on one route I'd like to render an html template that turns a local json file into a table. When using getJSON for some reason the localhost/server cannot find the file no matter how I've defined the path so the table always only...
Hi there,
I've been trying for a long time today to write a program in python which presses the "a" key for 20 seconds, then pauses for 2 seconds and then presses the "d" key for 20 seconds and this should repeat infinitily. But I couldn't do that. If someone could help me, that would be very...
Hi All,
I have
2 -> .XLS files (with header),
1 -> .XLSX file and
1 -> .XLSX file (password protected)
I have to read these files optimally and create respective .CSV files
- What would be the best optimized approach?
- What are the necessary libraries required? Can one library solve this...
Hello,
I recently published an app that I built for google play,
I would like to reviews from you about the app and suggestions for improvements.
The app is made for python learning, practice, and competing against online players.
App name: Sigma- code wars
Link...
Hello, I basically have worked out a cumulative rate and have it as a pandas column, see attached below: The confidence bounds I want are for the column CumSum which was calculated from taking all individual rates (Rind ) so Cumsum[0] is the sum of all Rind from Rind[0] to Rind[1663] and...
Hi everyone,
I am trying to integrate a code which is a variational auto encoder model (where the prior of the VAE is a mixture of Gaussians) from Lua (torch) to pytorch as part of my model and I have a hard time to fully understand the Lua script (I didn't find a tutorial of the language)...