Answers for "how to code python!!"

2

how to code python

# Lesson 1
# The HASHTAG (#) symbol is used to make comments about your code.
# Most programmers will use them when identifying what a new section of code does.
# The shortcut in most programs to comment out a line is ctrl + / .

# Print() makes a line-break in your output.
print()
# This will print out the words hello world in the console. Run it and see.
print('hello world')
Posted by: Guest on December-05-2021
4

python code

# Python 3: Fibonacci series up to n
>>> def fib(n):
>>>     a, b = 0, 1
>>>     while a < n:
>>>         print(a, end=' ')
>>>         a, b = b, a+b
>>>     print()
>>> fib(1000)
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987
Posted by: Guest on August-10-2021

Python Answers by Framework

Browse Popular Code Answers by Language