#basics

Опубликовано: 24 Сентябрь 2024
на канале: Mastering Technology
113
10

Basics of Python Programming:

1. Indentation
Whitespace is used at the beginning of the line to define the block.

2. Conditions - If/elif/else

3. Loops
While and For loop. Do-while is not used in Python.

4. Range() Function
It returns a sequence of numbers starting from 0 by default and incrementing by 1 (by default) and stops before a specified number.
range(start, stop, step)

5. Difference between break and Continue Statement

The break statement is used to terminate the loop immediately when it is encountered.
for i in range(5):
if i == 3:
break
print(i)
Output : 0 1 2

This statement is used to skip the current iteration of the loop and control transfers to the next iteration.
for i in range(5):
if i == 3:
continue
print(i)
Output : 0 1 2 4

Basic Problems to try for Beginners:

1. Program to swap two variables without using temporary variable

2. Program to check whether a number is prime or not.

3. Program to check whether a number is odd or even.

4. Program to find the factorial of a number.

5. Program to write Fibonacci series by taking user input.

#pythonprogramming #indentation #condition #ifelsestatement #elif #loops #while #dowhileloop #forloop #range #function #in #keyword #breakstatement #continuestatement #basic #problems
#like #share #subscribemychannel


На этой странице сайта вы можете посмотреть видео онлайн #basics длительностью online в хорошем качестве, которое загрузил пользователь Mastering Technology 24 Сентябрь 2024, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 113 раз и оно понравилось 10 зрителям. Приятного просмотра!