PROBLEM SET 0: PLAYBACK SPEED | SOLUTION (CS50 PYTHON)

preview_player
Показать описание


––– DISCLAIMER –––

The following videos are for educational purposes only. Cheating or any other activities are highly discouraged!! Using another person’s code breaks the academic honesty guidelines. This solution is for those who have finished the problem sets and want to watch for educational purposes, learning experience, and exploring alternative ways to approach problems and is NOT meant for those actively doing the problem sets. All problem sets presented in this video are owned by Harvard University.

–––
Рекомендации по теме
Комментарии
Автор

i was stuck searching in docs for soo long, tysm

tanishq
Автор

I’m low-key mad at myself because I’ve been reading the docs, and I thought of the replace but I just wasn’t sure 😭😅thank you so much

moeletsimelamu
Автор

Despite having low audience i love how much effort you put into your channel i wish you grow more and reach out to more people like me. Making people learning much smoother.

FahimIstihadAnik
Автор

thank you. i had used the replace method too

programram-hght
Автор

Another solution to this problem could be

msg = input(" ")

print(msg.replace(" ", "..."))

notwenli
Автор

Giovanna I would like to thank you for this tutorial, I was struggling during a week to know how to send a validation code, I hope some day to be in your group

webheringer
Автор

This is interesting. I had a completely different approach.. That's what I love about programming. So many different ways to solve the same problem. I used split and join as follows:

text = input()
words = text.split()
result ='...'.join(words)
print (result)

freshk
Автор

I didn't know about replace function while solving had to search it up

sakshamgarv
Автор

Thanks! I was stuck, I finished but It took a lot of time to solve for me

sakshamgarv
Автор

My solution is #define main function
def main():
#assign a variable named slowdown with input for user prompt
slowdown = input("")
#split slowdown into each word
eachword = slowdown.split()
#join each word with ... sep
word = "...".join(eachword)
print(word)
main()
Mine has more line of codes which I've learnt has more probability for errors. Do you think my solution will be useful in a different situation or more complex programs? I feel more comfortable to define a fucntion because I believe I can call it whenever I want again. I'd like to read your guidelines and sugguestions pls seniors.

wsptxtd
Автор

Thanks a lot! How do we do the check50 ? Mine asks for a security key or something -__-

FallenAngelMMA
Автор

I made one but mine only had the "..." at the end of the sentence. I had no idea what function would work and sorry im not going through the monstrosity that is the python doc to find something I would still be confused on using. Thanks!

fatjawns
Автор

Please learn the rest of the problem sets, I learn very well with you, please post the rest of your Python problem sets❤️🥲

maede
Автор

Hello, thank you so much for the videos, going to start college at IMC in austria and also having my own solution to this pset:

user_input = input("Write something here: ")

x = user_input.split(" ")

for word in x:
if word == x[-1]:
print(word)
break
print(word, end="...")




also working fine :)

fabianzaiser
Автор

How can i do it by myself
I watched my courses video and i still don’t know how to write a code or pass my problem set without help?

heliamousavi
Автор

Can you also use sep='...' instead of the replace function? If so, how would that look?

zobaonwuli
Автор

message = input()

print(message.replace(" ", "..."))


also works

sahilsvision
Автор

i came from cs50, and i didn't solve this problem set with replace function because i didn't know it
so i solved it with that

massage = input("").split(" ")

last = massage[-1]
massage.pop(-1)

for i in massage :
print(i, end="...")

print(last)



it worked i wonder if it was good or what

mohamedalaafahim
Автор

Did similar using replace but did it with a function

def dotted_lines():
print(input().replace(" ", "..."))



dotted_lines()

johnbackman
Автор

Why we can not use split method and put the prameter(...)

mariamgalal