24042/foreach-equivalent-in-python
I am new to Python and I have some experience in C#. I am looking for an equivalent function in python for iteration of all the items in collection.
For example:
names = ['joy', 'sam', 'dan'] marks = [ 3, 4, 7, 2, 1]
You can use a for loop as an equivalent as such:
for f in names: print f
Its also interesting to observe this To iterate ...READ MORE
Every occurence of "foreach" I've seen (PHP, ...READ MORE
Gotos are universally reviled in computer science ...READ MORE
Yes, there is a "foreach" in python. ...READ MORE
suppose you have a string with a ...READ MORE
You can also use the random library's ...READ MORE
Syntax : list. count(value) Code: colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...READ MORE
result = "F" if(isfemale_bit) else "M" print(result) Try this ...READ MORE
To indent the block, select the entire ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.