Hi All,
I want someone to tell me what goes on in the following scenario, I don't need the code I just want to understand what goes where i.e., array ,Boolean etc.
Here is the scenario.
Friends of Seaview Pier is an organisation devoted to the restoration and upkeep of a pier in the town. A...
I would like it to run rather than terminate itself:
#//Snake
#Import random for spawns, turle for graphics, time for pauses, and urllib for downloading icon
import random
import turtle
import time
import urllib.request
#//Downloading...
print("Downloading necessary files...")
#//Icon download...
Specific Prompt
Read in the included data file and write it to a file named sorted_data.txt with the same data, but order the columns in ascending alphabetical order.
The data comes from a .txt file and is randomly generated data going up to 1000
How would I approach writing this code...
Hello I am new here and looking forward to interact with the community. Currently I am learning Python. So I have a meme for the community. Try posting more such memes.
Credits: Data Scientists Love For Python
I got some code here(can anyone help solve this problem?):
while True:
n = raw_input("Ltr:")
if n.strip() == 'a':
print("01100001")
repeat='while True'
if n.strip() == 'b':
print("01100010")
repeat='while True'
#it goes on for every letter of the...
I am trying to make a website which has solutions of a book (5 chapters). Firstly, I want to open chapters.html with route /chapters which displays five submit buttons and chapter no. as their values.
<form action="/{{ chapter }}" method="POST">
<input type="submit" value="Chapter 1">...
import pyautogui
import tkinter
import sys
from tkinter import *
def delete():
while True:
pyautogui.click()
pyautogui.press('up')
pyautogui.hotkey('ctrl', 'a')
pyautogui.press('backspace')
for x in range(3)...
I understand that the cellDoubleClicked method passes the row and the column to a specified function, but how can I send additional information as function arguments? For example the list the table was filled with.
if I have the following fuction (with functools.partial imported):
def...
I want to split web page onto two parts. Static (top one) and scroll-able (bottom one). The problem is that solution I have creates a scroll-able box with fixed width and height. But I've seen an example of a page where bottom and right sections are limited by size of the browser screen and have...
I have a sound that I wish to play.
My code;
[...]
if var_camera_flip == 1:
if var_camera != 4:
pygame.mixer.Channel(2).play(pygame.mixer.Sound(r'audio\camera\camera motor.mp3'), -1)
else:
pygame.mixer.Channel(2).stop()...
This is only giving me one line back, I want all lines back. Is there a way to have iter_lines show all lines? Thanks.
#import modules
import requests
import json
import re
#retrieve lichess games for a specific user
def get_lichess_games(username):
api_session = requests.Session()...
How do I make this script ignore certain words when renaming files? Please help!
---
import pandas as pd
import os
from pathlib import Path as path
df = pd.read_excel("KODAIX.xlsx")
df = df.set_index('code')
folder = path(r'C:\Users\X\PycharmProjects\pythonProject3\MOZAIKX')
for file...
my_list = [1, 2]
for v in range(2):
my_list.insert(-1, my_list[v])
print(my_list)
The result of this is [1, 1, 1, 2], but I can't honestly comprehend why? Why isn't there a 0 then a 1? why isn't it after the 2 considering it is -1 for the placement in the list?
myList = []
for i...
I have 2 lists. For example
list_1 = ["a", "b", "c", "d"]
list_2 = ["A", "B", "C", "D"]
It should turn out:
total_list = [{"lower": "a", "upper":"A"}, {"lower": "b", "upper":"B"}, {"lower": "c", "upper":"C"}, {"lower": "d", "upper":"C"}].
I tried like this
list_data_dict = [{"lower": a_lower...
Am I able to also change colour by sliding the same slider I use to change image size ?
<body>
<center>
<p><-- low temp.</p><div class="slidecontainer">
<input type="range" min="15" max="25" value="15" class="slider" id="Slider">
</div><p>high temp. --></p>...
Hi. I'm coding a hangman game in Python & I've been getting an error that I can't figure out how to get rid off. Basically, after I take the user's letter, I create a counter that goes from 0 to the length of the word. However, since Python uses the number 0 first, instead of 1, I have to do the...
Implement a function called walker(x) that, given a list x of N numbers [x(0), x(1), x(2),..., x(N-1)], outputs a "walk list" y = [y(0), y(1),..., y(N)], defined recursively as:
y(0) = 0,
y(n) = y(n-1) + x(n-1), if 0 < n <= N
Hi, Code Forum.
We're a medium-sized agency & we're starting to use different programming languages to get better page speeds.
We have had many people tell us that Python & Django is the way to go.
We have had others say that using Headless WordPress with a JS Language like, next.js would be...
The problem is that,to write a function which generate a random matrix (bigger than 2x2). And calculate all the 2x2 part determinant of the original matrix.Then generate a new matrix with that values.
For example:
generated matrix
[4, 4, 8, 1
2, 6, 4, 7
1, 6, 6, 10]
calculated matrix
[16...
Hey Everyone! I have started a YouTube channel for answering coding interview questions. Do let me know if you want step by step explanation for any specific Python related coding problem. My first episode gives a brief explanation for one of the questions I faced during an interview.
My aim...