It took just 3-4 days for understanding basic syntax of python without holding other works because of your videos. These are to the point videos. Each minute has valid content. Thanks to You Mr. Naveen. Our colleges need teachers like you.
I was "Zero" in any programming, Now all my daily jobs is running with python, Because of Mr Naveen Reddy. Thank you sir, The way you teach is nothing but a solution you provide.
MAN, you're amazing teacher and I could learn this much python in 3 days and its because of you. I like your slang and also the teaching methods. Even after 2 yrs, yours is awesome one during search of course in youtube. Done well congrats :D
I possess a full Udemy course regarding Python3 and I'm quite good in python after finishing 70% of the course.. But I think it could have been better if I took Python3 knowledge from your lectures... Kudos to you reddy ji!!! ❤️❤️
bhai galat hh factorial ki value sidha dega yeh printing me x=int(input("enter any value")) fact=1 for i in range(1,x): fact=fact*i print(fact) yeh shii solution hhh
I'm learning python almost 1month but I have no much knowledge about array or others.. But when I start watching your tutorial, I have got much knowledge and improve myself. Thanks sir..
qn1. from array import * vals = array('i',[2,8,1,9,12]) for i in sorted(vals): print(i) qn2. from math import * num = int(input('kindly enter your number')) print(math.factorial(num))
@@crosswalker45 Reverse method parameter ni leta And sorted takes parameter.. That's why sorted(list) will work...and for working reverse, you need to directly call this with list..without any parameter..like List.reverse() This sending me one who doing programming
1) from array import * valori = array('i',[2,4,8,7,3,42,109,10000,100908]) while True: print(sorted(valori)) break 2) from math import* x=int(input("Qual è il fattoriale di questo numero?")) while True: print(factorial(x)) break
hello sir a simple request from side. could you please write assignment questions in description instead of showing them in end of video. If you do it for making suspense then it is okay but please show them in left bottom side instead of showing them on top because at the end of the video telusko logo comes and questions got invisible. So please consider this request. Thank You.. you are doing great!!
Factorial Algorithm created by me without using any prebuild function: print ( "Enter a Number to find its factorial: " , end="" ) inp = int ( input( ) ) ans = 1 for x in range ( inp ) : ans = ans * ( x + 1 ) print ( "Factor of" ,inp, "is:" ,ans )
## Sort array using selection sort ### import array as arr """ selection sort """ val = arr.array('i',[4, 5,-5,-12, 6, 7, -8]) print("before sort:",val) for a in range(len(val)-1): for b in range(a+1,len(val)): if val[a] > val[b]: val[a],val[b] = val[b],val[a] print(" after sort:",val)
The way you teach is really awesome, not making any confusion, sometimes we really want to have some doubt to ask but you are making it a bit difficult to have doubt☺️☺️
#1-sorting from array import * arr=array('i',[11,7,9,6,-4,3,5]) for i in range(len(arr)): for j in range(i+1,len(arr)): if(arr[i]>arr[j]): arr[i],arr[j]=arr[j],arr[i] print(arr) #2-factorial number=int(input("Enter a number:")) value=1 for i in range(1,number+1): value=value*i print(f"factoiral of {number} is",value)
from array import * values = array("i", [7,4,9,2,6,2,1]) x=len(values) for i in range(x): for j in range(i+1, x): if values[i]>values[j]: temp = values[i] values[i]=values[j] values[j]=temp print(values)
For solution of 1 : #To sort an array in ascending order from array import * vals = array('i', [1, 3, 8, 9, 2]) for i in range(len(vals)): for j in range(len(vals)): if( vals[i] < vals[j] ): a = vals[i] vals[i] = vals[j] vals[j] = a for i in range(len(vals)): print(vals[i])
On the 26th tutorial. starting as a complete Noob! however... your videos may be making me over confident lol. other than your very fast dialect you are one of the greatest teachers i have yet to encounter lol. thank you for posting these videos. Your hard work is very much appreciated.
program 1 from array import* vals= array('i',[2,5,1,3,6,4,9,8,7]) print(sorted(vals)) program 2 from math import* x= int(input('enter a no')) print(factorial(x))
I should thank you for Python Videos, I have spent lot of money for coaching center and learnt nothing. this is the best tutorial till now I found. many thanks to you.
Solution for no 1 from array import array as a nums = a("i",[99,85,57,91,100]) l = list(a for a in nums) l.sort() nums = a("i",(a for a in l)) print(nums)
Answer1 from array import * b=array('i',[]) n=int(input("Enter the length of array")) for i in range(n): x=int(input("Enter the next value")) b.append(x) for i in range(len(b)): for j in range(i+1,len(b)): if b[i]>b[j]: b[i],b[j]=b[j],b[i] print(b) Answer 2: n=int(input("Enter a number of which you want to find factorial for")) for i in range(n-1,0,-1): n=n*i print(n) print("The factorial of the given number is",n)
sorting an array without using inbuilt function from array import * arr = array('i',[6,23,44,21]) for i in range(4): for j in range(i+1): if arr[j]>arr[i]: arr[j],arr[i] = arr[i],arr[j] for x in range(4): print(arr[x])
Answers: (a) from array import * a=array('i', [12,10,18,2,17,29]) print(sorted(a)) (b) a = int(input("Enter any number: ")) for i in range(1, a): a = a*i print(a)
#sorted arrays from array import * vals = array("i" ,[5,9,11,16,3,10,2,1,6]) values = array(vals.typecode , (i for i in vals)) values = sorted(values) for i in values: print(i) #factorial from math import * x = int(input("Enter the number:")) for i in range(x): x = factorial(x) print(x) break
Sorting array without using sorted() - from array import * arr=array('i',[4,3,1,2,5,23,45,56,12,7,9]) for i in range(len(arr)): for j in range(len(arr)-i-1) : if arr[i]>arr[i+j+1] : arr[i],arr[i+j+1]=arr[i+j+1],arr[i] print(arr) Sir your Lectures are really amazing , Thanks a lot for helping us. Mee lanti teachers undadam maaku chaala anandamga undi. Future lo inka chaala videos upload chestarani aasistunnamu.
The best videos i have ever seen... U discussed every basic , which is extremely extremely extremely beneficial 😍😍... I m a beginner and also faced a lot of difficulties.. but after seeing ur vdos , now i m clear about python.. my next mission is Django... And i will follow ur videos so that I don't face any kind of difficulties...thank you sooooooooooooooo muchh🥰🥰🥰🥰🥰🥰
assigning old array to new: vals=array('i',[1,2,3,4]) newarray=vals this above statement also works then why we are doing this:- newarray=array(vals.typecode,(a for a in vals))
@@kalyan762 Here, "for a in vals" is similar to for loop, where "a" is a variable,used to traverse the vals. It picks values of array one by one and do the operation, since here only a(before for) is present it copies the array as it is. The only benefit of using this concept is that,we can do certain operations with all the values of vals and stores it in a new array but this is not possible with the syntax ->(newarray=vals) Ex-> newarray=array(vals.typecode,(3*a for a in vals)) ,multiplies every element of array with 3 and stores it in new array. Hope this will help you :)
from array import * a = array('i', [5, 4, 2, 3, 1, 56, 1]) print(a) for i in range(len(a)): for j in range(len(a)): if a[i] < a[j]: a[i], a[j] = a[j], a[i] print(a)
2) Factorial from array import * num = int(input("enter the number")) x = list() while num > 0: x.append(num) num = num - 1 print(x) y = int(1) for i in x: y = i * y print(y)
actually i think my logic is wrong,ad on decrementing x also,nothing will happen.... u check on ur complier u'll know. Btw, do u know from where to learn ML
I've warched and searched so many videos on internet but found no one conceptual however Reddy's lectures are conceptual and has practical approch. Stay blessed reddy bro
Sir whole day we eagerly wait for your quality, elaborately discussed videos but recently someday you don't upload even a single video.. Please sir at least upload two your quality videos daily 🙏🙏..
"""lets try and sort an array in ascending order""" from array import * vals=array('i',[9,2,8,6,7]) print(vals) for i in range(5): for j in range(i+1,5): if vals[i]>=vals[j]: vals[i],vals[j]=vals[j],vals[i] print(vals)
@@gauravmalhotra007No limits in programming. There are multiple ways of doing it since people take different approach, the most preferred method is the simple one to save memory. . >>>vals.sort(reverse = True)
def f(x): if x==1: return 1 else: return (f(x-1)*x) x=int(input("Enter:")) print(f(x)) Code for finding factorial of a number I have used the method of recursion here
finally i have command over range in python, here is solution for Q2: x=int(input("factorial of which num you want")) f=1 for i in range(x+1,1,-1): print(f, "*", i," = ",end=" ") f=f*i print(f) print("process complete: factorial of ",x," is :",end=" ") print(f) glad to learn python with navin, thank you.
Sir... copying array works like simple variable assignment. array1 = newArr, we don't need to use typecode, for and all. It worked. :) #Arrays in python, copy one array to other array from array import * intArr = array('i',[1,2,4,6,8,3,7]) intArr2 = intArr #assgn (copy) intArr to new array intArr2 for e in intArr2: print(e) Output: 1 2 4 6 8 3 7 Process finished with exit code 0
Great! But it does not work for a=0 (i.e. 0! = 1) Solution (considering only positive or null values of a): a = int(input("Enter any number: ")) f = 1 for i in range(1,a+1): f *= i print(f)
1: from array import * vals = array ('i', [2,4,-6,8,] ) svals = sorted(vals) print(svals) 2: n= int(input("Enter the value of a number")) factorial=1 while n>1: factorial=factorial*n n=n-1 print(factorial)
1) import array as a v=a.array('i',[98,76,56,99,45,44]) print(sorted(v)) 2) i think second assignment question is factorial of given number import math num=int(input("enter the number which your going to do factorial : ")) b=math.factorial(num) print(b) or import math as a num=int(input("enter the number which your going to do factorial : ")) b=a.factorial(num) print(b) or from math import factorial num=int(input("enter the number which your going to do factorial : ")) l=factorial(num) print(l)
To find the factorial of a given number without using math.factorial n=int(input("Enter a number")) if n0: p=n for a in range(1,n): m=p*a if a==n-1: print(m) elif a
1. A code to sort the array in ascending order alphabets = array('u', ['a', 'q', 'b', 'k', 'z', 'f']) print(sorted(alphabets)) nums = array('i', [55, 7, 0, 65, 20, 34]) print(sorted(nums)) 2. A code to find the factorial of given number fact = array('i', [2, 5, 3, 7]) for f in fact: print(factorial(f))
newArr = vals doesn't create a new array, it assings the 'vals' array to the 'newArr' tag. Thus, each change on the 'vals' array will affect the 'newArr' array, as these are the same arrays. But, it seems that works fine: newArr = array(vals.typecode, vals)
It took just 3-4 days for understanding basic syntax of python without holding other works because of your videos. These are to the point videos. Each minute has valid content. Thanks to You Mr. Naveen. Our colleges need teachers like you.
That's right
Bro I truly agree
that's call comment
It took me 3-4 days to understand what he is saying.
Visual information is the best way of learning something
wtf? Almost everytime when i try to guess new things and searching, always this man is on first page with best tutorials. Thank you man))
One reason being, Google/TH-cam filters content according to your preferences. 😄
Oh i got to know array in Python is new thing!!
this generation kids use bad words fluently without hesitation bruh
~wise kid
@@anonymous-w6y+1 For U😂❤
India needs more teacher like u....we pay laks of fees to clg and learns nothing .
it is clear!
I see you didn't learn English too
@@pragyanbimali66 can we get English class tutorial from you..
😭🤣
@@shameelsha sure!
I was "Zero" in any programming, Now all my daily jobs is running with python, Because of Mr Naveen Reddy. Thank you sir, The way you teach is nothing but a solution you provide.
MAN, you're amazing teacher and I could learn this much python in 3 days and its because of you. I like your slang and also the teaching methods. Even after 2 yrs, yours is awesome one during search of course in youtube. Done well congrats :D
I possess a full Udemy course regarding Python3 and I'm quite good in python after finishing 70% of the course.. But I think it could have been better if I took Python3 knowledge from your lectures...
Kudos to you reddy ji!!!
❤️❤️
U9yt
Started following your videos on Python. Your way of explanation is amazing. Our country needs teacher like you :)
To find factor of a given number:
Import math as m
a = int(input("Enter your number: "))
print(m.factorial(a))
that helps thank you :)
@@NikSy 'import' ( lowercase i ) :-)
How did u get this??
bhai galat hh factorial ki value sidha dega yeh printing me
x=int(input("enter any value"))
fact=1
for i in range(1,x):
fact=fact*i
print(fact)
yeh shii solution hhh
Great learning experience. Thanks a lot sir. Atleast a guy like me who didn't had any interest in computers , started watching and practicing Python .
I'm learning python almost 1month but I have no much knowledge about array or others.. But when I start watching your tutorial, I have got much knowledge and improve myself.
Thanks sir..
i wish i had professors or HOD like him engineering would have been heaven
qn1.
from array import *
vals = array('i',[2,8,1,9,12])
for i in sorted(vals):
print(i)
qn2.
from math import *
num = int(input('kindly enter your number'))
print(math.factorial(num))
num = 1
x = int(input("Enter the Number:\t"))
for i in range(1, x+1):
num = i * num
print(num)
1) from array import *
vals=array('i',[1,50,8,25,91,22])
vals=sorted(vals)
print(vals)
Why we haven't be use sorted like
vals.sorted()
But we use reverse
vals.reverse() like this???
@@priyanshupatel02 same doubt,,,,,I think it is based on somthing like return function,,,,If u got the answer,,then plz let me know too!!
@@crosswalker45 Reverse method parameter ni leta
And sorted takes parameter..
That's why sorted(list) will work...and for working reverse, you need to directly call this with list..without any parameter..like List.reverse()
This sending me one who doing programming
#ArraySorting
from array import array
x = array('I',[0,10,7,2,63,19])
print(sorted(x))
import array
a=array.array('i', [23,22,56,97,-68])
b=sorted(a)
for i in b:
print(i)
It would be better in case you want integers individually
@@dhruvdutt2749 Why arrray.array, array( , ) is sufficient na?
@@harikpriyatirumalaraju674 not in my situation
Dhruv Dutt why?
@@harikpriyatirumalaraju674 because i used import array instead of From array import Array/ From array import *
print("Factorial finding machine")
user= int(input("Please enter you number"))
a=1
b=1
for i in range(1,user+1):
if i
Second answer
number=int(input(type number))
factorial=1
for I in range(1,number+1):
factorial=factorial*i
print(factorial)
Awesome bro
Factorial*I
answer of 2nd question is
import math
a = int(input("Enter your number: "))
print(math.factorial(a))
bhai galat hh isme direct value print kr dega
x=int(input("enter any value"))
fact=1
for i in range(1,x):
fact=fact*i
print(fact)
1)
from array import *
valori = array('i',[2,4,8,7,3,42,109,10000,100908])
while True:
print(sorted(valori))
break
2)
from math import*
x=int(input("Qual è il fattoriale di questo numero?"))
while True:
print(factorial(x))
break
❤❤❤❤🎉🎉
hello sir
a simple request from side.
could you please write assignment questions in description instead of showing them in end of video.
If you do it for making suspense then it is okay but please show them in left bottom side instead of showing them on top because at the end of the video telusko logo comes and questions got invisible.
So please consider this request.
Thank You.. you are doing great!!
Thank Q sir,We are paying fee in colleges but it does'nt give the practical Knowledge,but your are giving your best.Keep doing videos and inspire many
from array inport*
vals=array('i,[1,2,3,4])
i=0
while i
It just prints 1 infinitely bro and there are typo mistakes .
Factorial Algorithm created by me without using any prebuild function:
print ( "Enter a Number to find its factorial: " , end="" )
inp = int ( input( ) )
ans = 1
for x in range ( inp ) :
ans = ans * ( x + 1 )
print ( "Factor of" ,inp, "is:" ,ans )
very good
## Sort array using selection sort ###
import array as arr
""" selection sort """
val = arr.array('i',[4, 5,-5,-12, 6, 7, -8])
print("before sort:",val)
for a in range(len(val)-1):
for b in range(a+1,len(val)):
if val[a] > val[b]:
val[a],val[b] = val[b],val[a]
print("
after sort:",val)
from array import *
val = array('i',[21,15,43,-66,100])
print("sorted array = ", sorted(val))
"welcome back aliens" never thought I would enjoy this sentence
But we r humans 🦍🦍🦍
@@stockfish3379 are we?
@@stockfish3379 we are aliens wrt the aliens
Perfect said
@tcfreestyler123x what is that
The way you teach is really awesome, not making any confusion, sometimes we really want to have some doubt to ask but you are making it a bit difficult to have doubt☺️☺️
For factorial of a number
x=int(input('Please enter your number'))
j=i=1
while i
#1-sorting
from array import *
arr=array('i',[11,7,9,6,-4,3,5])
for i in range(len(arr)):
for j in range(i+1,len(arr)):
if(arr[i]>arr[j]):
arr[i],arr[j]=arr[j],arr[i]
print(arr)
#2-factorial
number=int(input("Enter a number:"))
value=1
for i in range(1,number+1):
value=value*i
print(f"factoiral of {number} is",value)
instead of using value = value * i you can use value *= i to make it simpler
Telusko is the Best Channel on the Earth to Learn Programming! Hats Off... Dear Navin!
from array import *
values = array("i", [7,4,9,2,6,2,1])
x=len(values)
for i in range(x):
for j in range(i+1, x):
if values[i]>values[j]:
temp = values[i]
values[i]=values[j]
values[j]=temp
print(values)
for swap u csn use a[i],a[j]=a[j],a[i]
Here you use selection sort algorithm am I correct?
For solution of 1 :
#To sort an array in ascending order
from array import *
vals = array('i', [1, 3, 8, 9, 2])
for i in range(len(vals)):
for j in range(len(vals)):
if( vals[i] < vals[j] ):
a = vals[i]
vals[i] = vals[j]
vals[j] = a
for i in range(len(vals)):
print(vals[i])
On the 26th tutorial. starting as a complete Noob! however... your videos may be making me over confident lol. other than your very fast dialect you are one of the greatest teachers i have yet to encounter lol. thank you for posting these videos. Your hard work is very much appreciated.
from array import *
a=array('i' , [2,6,5,0,1])
b=array('i',[])
for y in range(max(a)+1):
if y in a:
b.append(y)
else:
pass
print(b)
it cannot order the negative numbers i-e(-6)
from array import*
valu = array('i',[5,4,3,2,1])
vals = sorted(valu)
newarr = array(valu.typecode,vals)
for e in newarr:
print(e)
The quiz questions at the end are being covered. Can you please mention it in the description
true the sub button must be placed at bottom right
q-2 searching number
import array as arr
nums=arr.array('i',[9,16,13,12])
i=0
value=int(input("enter the value to search"))
while i
from array import *
yes = array('i',[33,44,22,11])
print(sorted(yes))
in qustion, it is asked for alphabet arrangement
am telling you you've done a good job... i went in the bush.... lol
thnx man it helped me
bro where you get aaray in pycham aaray is working
Lol write the code in loop not pre defined functions 💩💩💩💩🤦♂️💩💩
I love your way of explaining,as you first do it wrong,then tell us the write method.
Thank You 😀😀
program 1
from array import*
vals= array('i',[2,5,1,3,6,4,9,8,7])
print(sorted(vals))
program 2
from math import*
x= int(input('enter a no'))
print(factorial(x))
Print(math.factorial(x))
For finding the factorial of a number:-
x = int(input("enter the number"))
y=1
if(x
sir im enjoying the python course
you are doing such A GRAET WORK
I should thank you for Python Videos, I have spent lot of money for coaching center and learnt nothing. this is the best tutorial till now I found. many thanks to you.
n=int(input("no.?"))
i=1
out=1
while i
nice ,different solution
Fk it's working
Such a great lesson, genuinely considering learning hindi just to honor one of the best teachers I've ever had!
Solution for no 1
from array import array as a
nums = a("i",[99,85,57,91,100])
l = list(a for a in nums)
l.sort()
nums = a("i",(a for a in l))
print(nums)
You may also use nums only in place of a for a in nums, just to improve efficiency
Answer1
from array import *
b=array('i',[])
n=int(input("Enter the length of array"))
for i in range(n):
x=int(input("Enter the next value"))
b.append(x)
for i in range(len(b)):
for j in range(i+1,len(b)):
if b[i]>b[j]:
b[i],b[j]=b[j],b[i]
print(b)
Answer 2:
n=int(input("Enter a number of which you want to find factorial for"))
for i in range(n-1,0,-1):
n=n*i
print(n)
print("The factorial of the given number is",n)
sorting an array without using inbuilt function
from array import *
arr = array('i',[6,23,44,21])
for i in range(4):
for j in range(i+1):
if arr[j]>arr[i]:
arr[j],arr[i] = arr[i],arr[j]
for x in range(4):
print(arr[x])
You are the only teacher who makes me feel that coding is not so difficult as I think.. Thank you sir
no=int(input("Enter any number: "))
fact=1
for n in range(no,1,-1):
fact=fact*n
print("The factorial of ",no," is: ",fact)
In range u have to give 0 in 2nd place
Not 1 😔
She saved time by eliminating multiplication with 1.
Answers:
(a)
from array import *
a=array('i', [12,10,18,2,17,29])
print(sorted(a))
(b)
a = int(input("Enter any number: "))
for i in range(1, a):
a = a*i
print(a)
n=int(input("Enter the number whose factorial you want to know: "))
m=1
for i in range(1,n+1):
m=m*i
print(m)
Why n+1 ??
@@soumsgaming238 because it will go from 1 to n.. definition of range
@@hritwikhaldar9272 Accha thank you I am learning python
Hritwik Haldar Hey a try fixing your code bit ! It doesn’t work if I give 0 😁😉
from array import *
v=array('i',[12,3,5,6,1,0])
p=sorted(v)
print(p)
Code to arrange in ascending order
#sorted arrays
from array import *
vals = array("i" ,[5,9,11,16,3,10,2,1,6])
values = array(vals.typecode , (i for i in vals))
values = sorted(values)
for i in values:
print(i)
#factorial
from math import *
x = int(input("Enter the number:"))
for i in range(x):
x = factorial(x)
print(x)
break
Sorting array without using sorted() -
from array import *
arr=array('i',[4,3,1,2,5,23,45,56,12,7,9])
for i in range(len(arr)):
for j in range(len(arr)-i-1) :
if arr[i]>arr[i+j+1] :
arr[i],arr[i+j+1]=arr[i+j+1],arr[i]
print(arr)
Sir your Lectures are really amazing , Thanks a lot for helping us. Mee lanti teachers undadam maaku chaala anandamga undi. Future lo inka chaala videos upload chestarani aasistunnamu.
I like the style in the end of every video--" ba biie" 🤭🤭😂😂
...
n = int(input('Enter the Number= '))
for i in range(1,n):
n = n*i
print('Factorial of the Number is=',n)
Finally the wait is over 2 days was a long time without you sir😊
We love you sir
The best videos i have ever seen... U discussed every basic , which is extremely extremely extremely beneficial 😍😍... I m a beginner and also faced a lot of difficulties.. but after seeing ur vdos , now i m clear about python.. my next mission is Django... And i will follow ur videos so that I don't face any kind of difficulties...thank you sooooooooooooooo muchh🥰🥰🥰🥰🥰🥰
assigning old array to new:
vals=array('i',[1,2,3,4])
newarray=vals
this above statement also works then why we are doing this:-
newarray=array(vals.typecode,(a for a in vals))
What happens in a for a in vals? I didnt get that
@@kalyan762 Here, "for a in vals" is similar to for loop, where "a" is a variable,used to traverse the vals. It picks values of array one by one and do the operation, since here only a(before for) is present it copies the array as it is.
The only benefit of using this concept is that,we can do certain operations with all the values of vals and stores it in a new array but this is not possible with the syntax ->(newarray=vals)
Ex-> newarray=array(vals.typecode,(3*a for a in vals)) ,multiplies every element of array with 3 and stores it in new array.
Hope this will help you :)
@@sameernayak9611 thanks a lot for such clear explanation
from array import *
a = array('i', [5, 4, 2, 3, 1, 56, 1])
print(a)
for i in range(len(a)):
for j in range(len(a)):
if a[i] < a[j]:
a[i], a[j] = a[j], a[i]
print(a)
Thank you sir🎉
2) Factorial
from array import *
num = int(input("enter the number"))
x = list()
while num > 0:
x.append(num)
num = num - 1
print(x)
y = int(1)
for i in x:
y = i * y
print(y)
Best tutor on TH-cam for Python!
#Factorial
num=int(input("Enter number: "))
fact=1
while(num>0):
fact*=num
num-=1
print("factorial is: ",fact)
why my program is not working
x=int(input('enter a no'))
num=1
while x>num:
x=x*num
num=num+1
print(x)
lol,my num is 1, how can i make it num-1, it will go to zero then negative
actually i think my logic is wrong,ad on decrementing x also,nothing will happen....
u check on ur complier u'll know.
Btw, do u know from where to learn ML
@@neelesh621 nope i don't know
I've warched and searched so many videos on internet but found no one conceptual however Reddy's lectures are conceptual and has practical approch.
Stay blessed reddy bro
Sir whole day we eagerly wait for your quality, elaborately discussed videos but recently someday you don't upload even a single video.. Please sir at least upload two your quality videos daily 🙏🙏..
Instead of replying, our tutor gave you a 'Heart Like', I wonder 'Like' is the acceptance of your request or what....
Donate; lol. You're at the mercy of an electronic guru/sensei
2nd quiz question answer
x = input("enter the number for the factorial")
i = 1
fact = 1
while i
"""lets try and sort an array in ascending order"""
from array import *
vals=array('i',[9,2,8,6,7])
print(vals)
for i in range(5):
for j in range(i+1,5):
if vals[i]>=vals[j]:
vals[i],vals[j]=vals[j],vals[i]
print(vals)
It works but it's not efficient..
@@leepierrelephiri7944 any suggestions..wat can be done? pls help
@@gauravmalhotra007No limits in programming. There are multiple ways of doing it since people take different approach, the most preferred method is the simple one to save memory.
.
>>>vals.sort(reverse = True)
@@leepierrelephiri7944 thank u
@@gauravmalhotra007 '''vals[i],vals[j]=vals[j],vals[i]''' can you plz help explain me this line!!!!
def f(x):
if x==1:
return 1
else:
return (f(x-1)*x)
x=int(input("Enter:"))
print(f(x))
Code for finding factorial of a number
I have used the method of recursion here
num=8
fact=1
if fact
shouldn't it be num instead of fact in if else statement
Keepe Print(fact) with for loop
Otherwise it will print all the values
finally i have command over range in python,
here is solution for Q2:
x=int(input("factorial of which num you want"))
f=1
for i in range(x+1,1,-1):
print(f, "*", i," = ",end=" ")
f=f*i
print(f)
print("process complete: factorial of ",x," is :",end=" ")
print(f)
glad to learn python with navin,
thank you.
2nd
import math
x=int(input(" enter the value"))
var=math.factorial(x)
print(var)
Hehe, nice work lazy dude!
how can i repeat this script?
after getting the result it should ask for another number to enter
Sir... copying array works like simple variable assignment. array1 = newArr, we don't need to use typecode, for and all. It worked. :)
#Arrays in python, copy one array to other array
from array import *
intArr = array('i',[1,2,4,6,8,3,7])
intArr2 = intArr #assgn (copy) intArr to new array intArr2
for e in intArr2:
print(e)
Output:
1
2
4
6
8
3
7
Process finished with exit code 0
2)
a=int(input("Enter any number:"))
for i in range(1,a):
a=a*i
print(a)
Great! But it does not work for a=0 (i.e. 0! = 1)
Solution (considering only positive or null values of a):
a = int(input("Enter any number: "))
f = 1
for i in range(1,a+1):
f *= i
print(f)
im not enjoying the series....im relishing it!!....Sir u are a blessing for newbies like me!!!
You are a very good teacher. Love your Python tutorials! Thank you!!
1:
from array import *
vals = array ('i', [2,4,-6,8,] )
svals = sorted(vals)
print(svals)
2:
n= int(input("Enter the value of a number"))
factorial=1
while n>1:
factorial=factorial*n
n=n-1
print(factorial)
from array import *
arr=array('i',[3,8,5,9,3,6])
arr1=sorted(arr)
print(arr1)
For descending order?
@@Rajkumar-vc2pg just type above print(arr1)
arr1.reverse() then you will get decending order
@@raghavchakravorthy3896 yea I'm liking that.. But i don't think it is efficient way to do
factorial???
Sort not working in array
He taught the for loop in arrays. What a LEGEND!
2..........
import math
x=int(input('enter the value '))
for i in range(2,x+1):
if x%i==0:
print('factorial of number is',i)
code isn't working brother!
import math as m
x=int(input('enter the number;-'))
print(m.factorial(x))
Answer 2:
from array import *
val = int(input("number"))
result = 1
for x in range(1,val+1):
result*=x
print(result)
2.ans
import math as m
x=int(input("enter num of you want factorial"))
print(m.factorial(x))
2.
n = int(input('Enter the number '))
count = 1
for i in range(1, n+1):
count = count * i
print(count)
wrong answer my friend
1)
import array as a
v=a.array('i',[98,76,56,99,45,44])
print(sorted(v))
2) i think second assignment question is factorial of given number
import math
num=int(input("enter the number which your going to do factorial : "))
b=math.factorial(num)
print(b)
or
import math as a
num=int(input("enter the number which your going to do factorial : "))
b=a.factorial(num)
print(b)
or
from math import factorial
num=int(input("enter the number which your going to do factorial : "))
l=factorial(num)
print(l)
#solution 1st problem
from array import *
val=array('i',[2,10,3,4,6])
val=sorted(val, key=int)
print(val)
hey hi your code is working fine even without the ("key = int"). May I know y u place the key keyword.
Wats the use of key ?
Print(sorted(var)) will do
i am glad that i found your channel on top when i searched for python and rest is history.
Thanks😊❤
Great work
Please make videos on the python projects
It will be very helpful to us
To find the factorial of a given number without using math.factorial
n=int(input("Enter a number"))
if n0:
p=n
for a in range(1,n):
m=p*a
if a==n-1:
print(m)
elif a
from array import *
vals = array('d',[4,3,1,12])
vals=sorted(vals)
print(vals)
really found this channel very useful any people dont go deep in beginners python but u taught us from basic to deep so very much thankyou to u sir
Solution for 2.
No=5
Fact=1
For i in range(1,no+1):
Fact=fact*I
Print (fact)
Your explanation is very nice 👍👍
Solution of 1st problem
From array import *
S = array('i',[9,2,40,91,51,2])
For i in sorted (s):
Print (i)
1. A code to sort the array in ascending order
alphabets = array('u', ['a', 'q', 'b', 'k', 'z', 'f'])
print(sorted(alphabets))
nums = array('i', [55, 7, 0, 65, 20, 34])
print(sorted(nums))
2. A code to find the factorial of given number
fact = array('i', [2, 5, 3, 7])
for f in fact:
print(factorial(f))
I have a doubt:-
In lists we done like
Nums.sort()
But in array it is not working?
Print("No.1 coding teacher in India. Salute to this man")
Its very confusing....array array....yeh array array kya hai yeh array array
I'm new to Python
I am learning a lot from you
thank you my guru :D
Instead of writing newArr = array(vals.typecode, (a for a in vals)).
cant we directly write newArr = vals
Cool
We can but if we want more requirement in further, we has to initiate the typecode and requirement. It is better to know the depth subject right :)
newArr = vals doesn't create a new array, it assings the 'vals' array to the 'newArr' tag. Thus, each change on the 'vals' array will affect the 'newArr' array, as these are the same arrays. But, it seems that works fine:
newArr = array(vals.typecode, vals)