

6 Python exercise problems for beginners. Let’s go!
Also, Python book recommendations / what projects to work on:
Find me on Instagram:
And Twitter:
And Facebook:
Resources I mentioned in this video:
CodingBat:
Python 2 vs 3:
Project Euler:
Get Ready for Your Coding Interview:
Python book recommendations / what projects to work on:
source
Here’s my other video about what Python projects to work on: https://youtu.be/-1j0_SVaAJM
Also, some timestamps:
1:30: Problem 1
4:54: Problem 2
7:10: Problem 3
8:36: Problem 4
11:49: Problem 5
16:18: Problem 6
Oh btw, I recently set up a subreddit for you guys for asking each other any programming-related questions. Feel free to use it any way you’d like: https://www.reddit.com/r/csdojo/
def count_even(set_s):
total_r = 0
for i in set_s:
if i % 2 == 0:
total_r += 1
i += 1
return total_r
18:24 i found another solution !
def count_evens(nums):
result = 0
for i in nums :
n = (i – 2)/2
n= round(n)
if i == 2*n + 2 :
result += 1
return result
# it works 100%
what is difference between return anf print?
I am big fan
Hi
hello YK can we test palindrome number in python
how to print if shows the input is error
sir
Need ur assistance. Without knowing basics of algorithm i cannot learn python
Basics of algorithm and data structure lectures can u make it or could u plzzz share any book so that I can go through and really want to develop applications with python or whatever skills required
I have really lessss time in hand but want to do be success in coding
I'm suffering from a disease which I dnt wanna reveal so mentions( less time)
Plz brother need ur assistance
That codingbat site is far too difficult for beginners.
ok
Answers:
#Exercise 1
def sleep_in(weekday, vacation):
return not weekday or vacation
#Exercise 2
def string_times(str, n):
return str*n
#Exercise 3
def hello_name(name):
return f"Hello, {name}."
#Exercise 4
def first_last6(list):
return list[0] == 6 or list[len(list) -1] == 6
#Exercise 5
def double_car(string, n):
new_string = ''
for c in string:
new_string += c * n
return new_string
#Exercise 6
def count_evens(list):
count = 0
for j in list:
if j % 2 == 0:
count += 1
return count
If possible solve this
Magic constant generator:
Write the function definition for the generator named 'generator_Magic', which takes a single parameter 'n1'.
Define the above Generator such that it should yield the Magic constant (s) for the values starting from 3 to 'n1'.
Project Based #Python #Programming For #Kids & #Beginners 90% OFF ! #coupon for UDEMY COURSE
https://www.udemy.com/project-based-python-programming-for-kids-beginners/?couponCode=PYTHONLEARN10A
For the sleep_in problem, couldn't you put !weekday instead of not weekday? Or am I wrong…?
thaankkk youuuu!!!!!! 🙂 <3
It's the best video for beginers I have ever seen.
Boss you are very brilliant…. Next time more video…
At 12.30
Is this is correct
a="abc"
for i in a:
print(i*2)
Is this the last video of the series please?
Thank you from the bottom of my heart.
#For the last exercise:
def even_count(nums):
return len(nums) – sum([x%2 for x in nums])
# Don't know whay i am obsessed with .append() haha
def even_count(lst):
mylist = []
for item in lst:
if item%2 == 0:
mylist.append(item)
return len(mylist)
# I had this in mind first, just a begineer right now
def double_char(strng):
mylist = []
for letter in strng:
letter = letter*2
mylist.append(letter)
return "".join(mylist)
For problem #4, @ 8.36, I have an issue.
No matter which numbers I enter in nums,
The function always returns True, in all cases.
def first_last_6(nums):
if nums[0] or nums[-1] == 6:
return True
else:
return False
nobody:
hihihihihihihihhi
hey this is the same type of thing i am doing on my youtube channel.
You should try hackerrank also
ok I know this is just basics but, I really didn't understand the last one
@CS Dojo i think the problems at coding bat are way easy. Don't you think?
First Day As Python coder and loving these
This codingbat.com sucks on mobile version.