Dominic L
@Dominicl645
"it doesn't hurt to try, but it hurts to give up" .
github = https://github.com/dominicl645/XXXTentacion-tribute/wiki
Hey y'all, this is the beginning of my big repl that i am creating, tell me what you think and tell me where i can improve, but please DO NOT fork thi
Python
i need this so i can finish something up. pls help. thanks in advance! p.s. i would greatly appreciate the help, it means alot!
i am collaborating with another repl.it user and i am wondering how you would get a audio file to play in the index.html.
where would i have to go and
xxpertHacker If you're trying to do in (X)HTML, then everyone's already answered you.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio
If you wanted to start it from JavaScript, MDN has documentation on it:
https://developer.mozilla.org/docs/Web/API/HTMLAudioElement/Audio
https://developer.mozilla.org/docs/Learn/JavaScript/Client-sidewebAPIs/Videoandaudio_APIs
https://developer.mozilla.org/docs/Web/API/WebAudioAPI2 years ago
RYANTADIPARTHI Try this code:
from replit import audio
play('your file')
So now, all you have to do is click on the 3 dots, and get your file. And it makes a new file. Just take the name of the file and put it in the play:
Screenshot 2020-11-22 at 5.57.49 PM
That should work2 years ago
help, how should i go with this?
Create a list elementsList that contains the names of the first 20 elements in atomic number order. Print the even n
Coder100 something like:
elementsList = [...]
for i in range(len(elementsList)):
print("%d -- %s" % (i, elementsList[i]))
and for the second one:
elements60List = [...]
for i in range(len(elements60List), 2):
print("%d -- %s" % (i, elementsList[i]))
evidently you will need to actually put in the values inside the list.2 years ago
Which function can you use to test whether an absolute or relative path to a folder is valid? using the "os" module, how would you put this into repl.
Coder100 try this:
https://careerkarma.com/blog/python-check-if-file-exists/
import os
os.isdir("directory")
`2 years ago
if you don't mind, could you check this for me and see if i did it correctly? I'm not asking you to give me answers or anything like that, I just want
Python
RYANTADIPARTHI Looks pretty good, except for one thing. July fourth has passed. Might want to fix that.2 years ago
i have no clue on how to work the time module in python. if someone can please explain thoroughly on how to work it and help me with this one part, it
Python
Dominicl645 yall any help would be greatly appreciated. i am new to using the datetime and time modules2 years ago
ok, i have completed the first 2 parts on this, and i just need help on the last part, because i cannot figure out how to complete it, and make it do
Python
RYANTADIPARTHI try this
phrase = "what is your name"
d = input("split?")
splitting = phrase.split(d)
That should work2 years ago
so i am having to do this:
Write the code to multiply the numbers 1 through 7.
The output should look like: 1x2x3x4x5x6x7 = 5040
remember you can use
Python
RYANTADIPARTHI Use this code:
total = 1
for i in range(1, 8):
total = i * total
print(total)
That should work
`2 years ago
Coder100 You forgot that you are comparing to an integer!
Your list type is a string
You are comparing an int
so it will never be true!
Change your code to:
if threeNum[0] == "5":
threeNum[0] = "small"
print(threeNum)
elif threeNum[0] == "5":
threeNum[0] = "big"
print(threeNum)
or:
if int(threeNum[0]) == 5:
threeNum[0] = "small"
print(threeNum)
elif int(threeNum[0]) == 5:
threeNum[0] = "big"
print(threeNum)
`2 years ago
SUHASTADIPARTH1 You need to do this:
threeNum = ["2", "7", "9"]
if int(threeNum[0]) > 5:
threeNum[0] = 'small'
else:
threeNum[0] = 'large'
print(threeNum)
You need to convert that first index of the list into a integer, since you have all strings in your list
If you have a list of strings, convert the indices to integers
or
make the list all integers
do
threeNum = [2, 7, 9] instead of threeNum = ["2", "7", "9"]2 years ago
29f32ae0c85a7b5ac5280271a39993d3534dc4bb_hq
324855faab7035ad2c6f36f9344607e4
5006d13d5ffb64002427d7272c314a2b
3e8d9570f464127f244f891614cbfed4
c7915
Python
this is what i have to do:
Favorite Food program. Get user input for 1 favFood. Iterate through the letters in favFood and print each letter on a new
Python
Directions: Complete the following statements below:
Write the code for Capitalize Program.
a. Assign newName an empty string
b. Get user
Python
Kai_Justice newName = []
Turns the variable firstName into a list (ex. Kai -> ['K', 'a', 'i'])
Then it starts to iterate through the list.
for char in list(firstName):
print(char)
then if the char is "i" or "o" then you capitalize it.
if char in ["i", "o"]:
turns current char to uppercase version (ex. "i" -> "I")
char = char.upper()
adds the char to the list newName
newName.append(char)
VVVVVVV Joins the list into a string and prints it
print(''.join(newName))
>https://www.w3schools.com/2 years ago
Spacecraft You've been posting a lot of your homework questions lately. Your code is not much of an attempt, to be honest. You could have at least given the IF,ELIF,ELSE loop a try before posting. I'm adding a solution for this problem, but in the future, please make an honest attempt with your own code before asking for help.
def Capitalize(word):
newName = ""
for letter in word:
if letter == 'i':
newName += letter.upper()
elif letter == 'o':
newName += letter.upper()
else:
2 years ago
please help. i am trying to figure out more about python and i want to make a game, but i dont know how to use the imported replit and i dont know how
Python
qwertyuiop1111 Hey! I am looking to work on a game, and I am looking for someone to help. You were reccomended to me by @DigiLab . Please tell me if you are willing to work with me on a Python game. Thanks,
@qwertyuiop11112 years ago
RYANTADIPARTHI Turtle
Use turtle to make easy games. So once you've mastered it, just move on to pygame. Here are some links:
https://realpython.com/beginners-guide-python-turtle/
https://www.geeksforgeeks.org/turtle-programming-python/2 years ago
Muffinlavania Well if you want something like this Use python(with turtle)! This is super simple, nothing complicated like pygame(even though its not all that bad i think_2 years ago
so i basically have to do this:
Task #3:
Directions: Write the code for the following steps:
Write the code for Improved Multiplying Calculator:
·
Python
here is the third task...at first glance it seems simple. to me it is actually difficult and someone please help. any help is appreciated. thanks in a
Python
loyedneuer I appreciate you sharing your expertise and experience. Your website is really good. five nights at freddy's The amount of knowledge on your website is astounding.9 months ago
Coder100 Oh, on line 24 right?
The thing is you forgot to convert it into a int so it was still a string and concatenated the strings.
Here's the correct code:
if num1.isdigit() and num2.isdigit():
print(int(num1) + int(num2))
elif num1.isalpha() and num2.isalpha():
print("You did not enter a valid number")
elif num1.isdigit() and num2.isalpha():
print("You entered only one valid number")
elif num1.isalpha() and num2.isdigit():
print("You entered only one valid number")
else:
print("Do you even2 years ago
Instructions:
You are going to create the game Rock, Paper, Scissors. You are going to ask the user for either Rock, Paper or Scissors then compare
Coder100 Sure, try something like:
import random
choices = [ 'rock', 'paper', 'scissors' ]
computer_choice = random.choice(choices)
print (computer_choice)
your_choice = input("your choice: ")
if computerchoice == yourchoice:
print("tie!")
elif computerchoice == 'rock' and yourchoice != 'paper':
print("computer won!")
elif computerchoice == 'paper' and yourchoice != 'scissors':
print("computer won!")
elif computerchoice == 'scissors' and yourchoice != 'rock':
print("computer won!")
else:
prin2 years ago
An interesting problem in number theory is sometimes called the “necklace problem.” his problem begins with two single-digit numbers. The next number
Python
Spacecraft @dominicl645 The first 2 numbers in the sequence are added. If the sum of these 2 numbers is 10 or greater, subtract 10. This becomes the next number in the sequence. Repeat these steps until the last two numbers of the sequence are the same as the first two. Study this code to understand how it works:
necklace = []
value1 = int(input('Enter the first starting number: '))
value2 = int(input('Enter the second starting number: '))
necklace.append(value1)
necklace.append(value2)
exit = False
n = 22 years ago
Bookie0 hi can you precise your question? We can't just solve a problem for you; try starting by yourself first, what have you tried already, have do you think is wrong, what do you think could work, etc.
Ask your teacher if you don't fully understand the problem, and try to rephrase it so we can fully understand it! ;)
2 years ago
i am looking for people who want to make a game and would greatly appreciate it. this will be one of my hardest projects yet and would be grateful for
Python
What is your favorite NFL team? this information is going to good use, so please leave comment your answers. thanks in advance
Bookie0 The New York Giants because I'm from New York City. I'm not into NFL anyways.
If you want the whole team, you can check this out and this and this may help! ;)2 years ago