Загрузка страницы

BEGINNER PYTHON CODING - REVERSE WORDS IN A STRING

This is a beginner python coding exercise. Reverse words in a string!

💻 Code along with a Python 3 online compiler: https://www.onlinegdb.com/online_python_compiler
⭐ SUBSCRIBE to Apptato for more Brain Teasers, Code Challenges and interesting math problems!
💻 Problem taken from geeksforgeeks.org

Question:
Reverse Words in a given String

For example:
- 1 2 3 4 5 -- 5 4 3 2 1
- Reverse a String in Python 3 -- 3 Python in String a Reverse

Coverage & Review:
Array Split
Array Join
Array For Loop
Answer:

Code:

string = "5 4 3 2 1"

def reverseString(s):
wordArray = s.split(' ')
output = []
for word in wordArray:
output.insert(0,word)
return " ".join(output)

print(reverseString(string))
Thanks for watching
Until next time!
*** LINKS ***

Website: http://www.apptato.com
YouTube: https://www.youtube.com/apptato
Twitter: https://www.twitter.com/apptato
Facebook: https://www.facebook.com/apptato
Instagram: https://www.instagram.com/apptato

#CODE #PYTHON #PROGRAMMING

Видео BEGINNER PYTHON CODING - REVERSE WORDS IN A STRING канала Apptato Trivia & Word Games
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
26 июля 2019 г. 22:00:05
00:07:44
Другие видео канала
10 Canada Interesting Facts | Learn Something New About Canadian History and Culture Trivia10 Canada Interesting Facts | Learn Something New About Canadian History and Culture TriviaIQ TEST QUESTIONS AND ANSWERS #1 - Test your Brain with these 5 Challenging ProblemsIQ TEST QUESTIONS AND ANSWERS #1 - Test your Brain with these 5 Challenging ProblemsCROSSWORD PUZZLE SHORTS #2 - GENERAL KNOWLEDGE TRIVIA QUIZ (7 QUESTIONS AND ANSWERS)CROSSWORD PUZZLE SHORTS #2 - GENERAL KNOWLEDGE TRIVIA QUIZ (7 QUESTIONS AND ANSWERS)MENTAL MATHS QUIZ #5 - 1 MINUTE ADDITION SUBTRACTION DIVISION MULTIPLICATION MATH SPEED TEST #SHORTSMENTAL MATHS QUIZ #5 - 1 MINUTE ADDITION SUBTRACTION DIVISION MULTIPLICATION MATH SPEED TEST #SHORTSStroop Effect Test (Many Can't Do This Test!)Stroop Effect Test (Many Can't Do This Test!)MEMORY TEST GAME #6 | Memorize 3 Pictures & Answer 5 Questions | Brain Training Memory Test GamesMEMORY TEST GAME #6 | Memorize 3 Pictures & Answer 5 Questions | Brain Training Memory Test GamesMAZE GAMES #1 - Solve the 10 Halloween Trick or Treat Mazes | Family & Friends Game NightMAZE GAMES #1 - Solve the 10 Halloween Trick or Treat Mazes | Family & Friends Game NightBaseball Math Problem | Algebra for Beginners | Interesting Math Problems for All AgesBaseball Math Problem | Algebra for Beginners | Interesting Math Problems for All AgesANIMAL MATH QUIZ - 5 Challenging Animal Math Test Questions and AnswersANIMAL MATH QUIZ - 5 Challenging Animal Math Test Questions and AnswersINDIA TRIVIA QUIZ - 30 Indian General Knowledge Questions and Answers Pub QuizINDIA TRIVIA QUIZ - 30 Indian General Knowledge Questions and Answers Pub QuizCrossword Puzzles with Answers #7 (15 Comic Book Trivia Quiz Questions) | Word Games to PlayCrossword Puzzles with Answers #7 (15 Comic Book Trivia Quiz Questions) | Word Games to PlayMATH NUMBER SERIES PUZZLE #3 - WHAT NUMBER IS NEXT? (MATH SERIES) #SHORTSMATH NUMBER SERIES PUZZLE #3 - WHAT NUMBER IS NEXT? (MATH SERIES) #SHORTSGENERAL KNOWLEDGE TRIVIA QUIZ #4 | 10 General Knowledge Trivia Questions and Answers | Pub QuizGENERAL KNOWLEDGE TRIVIA QUIZ #4 | 10 General Knowledge Trivia Questions and Answers | Pub QuizSingapore Trivia Questions and Answers (15 Interesting Singaporean Facts) | General Knowledge QuizSingapore Trivia Questions and Answers (15 Interesting Singaporean Facts) | General Knowledge QuizFind the Difference #4 (3 Christmas Pictures) | Spot the Odd Differences Out on Christmas Eve / DayFind the Difference #4 (3 Christmas Pictures) | Spot the Odd Differences Out on Christmas Eve / DayMENTAL MATHS QUIZ #6 - 1 MINUTE ADDITION SUBTRACTION DIVISION MULTIPLICATION MATH SPEED TEST #SHORTSMENTAL MATHS QUIZ #6 - 1 MINUTE ADDITION SUBTRACTION DIVISION MULTIPLICATION MATH SPEED TEST #SHORTSFind the Difference #3 | Spot the Odd Differences Out | Family Game NightFind the Difference #3 | Spot the Odd Differences Out | Family Game NightGENERAL KNOWLEDGE TRIVIA QUIZ #5 | 10 General Knowledge Trivia Questions and Answers | Pub QuizGENERAL KNOWLEDGE TRIVIA QUIZ #5 | 10 General Knowledge Trivia Questions and Answers | Pub QuizWhat's the Missing Number and Why? | Interesting Math Problems for All AgesWhat's the Missing Number and Why? | Interesting Math Problems for All AgesHong Kong Parking Spot Riddle (Are you Smarter than a Hong Kong Grade School Student?)Hong Kong Parking Spot Riddle (Are you Smarter than a Hong Kong Grade School Student?)Super Mario Trivia Quiz - Test Your Nintendo General Knowledge TriviaSuper Mario Trivia Quiz - Test Your Nintendo General Knowledge Trivia
Яндекс.Метрика